API: Insurance

Insurance list

JWT Authorisation

GET /api/v3/insurance

Request parameter:

No Request parameter

API: _ Default behavior#List defaults

Response data:

Metadata: object.

ParameterTypeDescription
countintNumber of all results marching criteria 
statusintResponse status (same as in http code)

Data:  object.data[array]

ParameterTypeDescription
namestringContact name (virtual field) - made from name_1 and name_2 
name_1stringCompany name
name_2string|nullCompany addiction
idintegerContact id

Response (Error):

ParameterTypeDescription
codeintegerAn error code
errorstringA message containing some information about the error 
errorsarrayList of errors devided by field in associative array {field_name:error message}

/wiki/spaces/BROK/pages/693181 #Authentication defaults 

Request
curl -X GET https://public.brokerstar.biz/api/v3/insurance --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'


Response (Success)
200 OK 
{
    "count": "3",
	"status": 200,
    "data": [                 {
            "name": "CONVITUS Sammelstiftung",
            "name_1": "CONVITUS",
            "name_2": "Sammelstiftung",
            "id": 11478
        },
        {
            "name": "Credit Suisse ",
            "name_1": "Credit Suisse",
            "name_2": "",
            "id": 11416
        },
        [...]   
	]  
}

Or one of 

Single Insurance 

JWT Authorisation

GET /api/v3/insurance/{id}

Request parameter:

ParameterTypeInDescription
idinturlid of requested insurer

Response data:

Metadata: object.

ParameterTypeDescription
statusintResponse status (same as in http code)

Data:  object.data

ParameterTypeDescription
idintegerContact id
name_1stringLastname / Company name of the user
name_2string|nullFirstname / Company addition of the user
namestringContact name (virtual field) - made from name_1 and name_2 
plzstring|nullContact post code
phone_workstring|nullPhone to work
mobilestring|nullPhone (mobile)
mailstring|nullEmail
mandate_beginstring|nullMandate/Contract begin date
phone_directstring|nullPhone direct
phone_privatestring|nullProne private
mail_privatestring|nullEmail private
addressstring|nullContact address
citystring|nullContact city
ig_insurance[]arrayIg insurance 
ig_insurance[id]string|nullIg insurance  type id
ig_insurance[name]string|nullIg insurance  type name
ig_insurance[code]string|nullIg insurance  type code
finma_nostring|nullFirmaNo (XML)
sub_contactsarray of arraysList of sub API: Contact data and relation contact data
sub_contacts[*]arrayInformation about related Sub-Contact
sub_contacts[*][id]int|nullId of related sub-contact
sub_contacts[*][name]string|nullName of sub-contact
sub_contacts[*][name_1]string|nullSub contact first name or company name
sub_contacts[*][name_2]string|nullSub contact last name or company addiction
sub_contacts[*][relation]array|nullRelation information
sub_contacts[*][relation][description]string|nullDescription of relation

Response (Error):

ParameterTypeDescription
codeintegerAn error code
errorstringA message containing some information about the error 
errorsarrayList of errors devided by field in associative array {field_name:error message}
Request
curl -X GET https://public.brokerstar.biz/api/v3/insurance/227 --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'


Response (Success)
200 OK   
{
    "data": {
        "id": 227,
        "name_1": "AAR bus+bahn",
        "name_2": null,
        "name": "AAR bus+bahn ",
        "plz": "5001",
        "phone_work": "+41628328300",
        "mobile": "+41628328300",
        "mail": "aar@aar.ch",
        "mandate_begin": null,
        "phone_direct": null,
        "phone_private": null,
        "mail_private": null,
        "finma_no": "F12",
        "ig_insurance": {
            "id": 4,
            "name": "Generali",
            "code": "21S"
        },
        "address": "Centralbahnstrasse 21\r\nPostfach",
        "city": "Aarau 1",
        "fax": "+41614832105",    
		"sub_contacts": [
            {
                "id": 228,
                "name": "Fiabane Roberto",
				"name_1": "Fiabane",
				"name_2": "Roberto",
                "relation": {
                    "description": "Kontaktperson"
                }
            },
            [...]
        ]     
	},
    "status": 200
}
Response (Error)
404 Not found
{
	"error": "Entity not found",
	"code": 404
}

Or one of 

Single Insurance sub-contact


GET /api/v3/insurance/{id}/sub-contact/{sub_contact_id}

Request parameter:

ParameterTypeInDescription
idinturlid of requested insurer
sub_contact_idinturlid of contact related to insurer

Response data:

Metadata: object.

ParameterTypeDescription
statusintResponse status (same as in http code)

Data:  object.data

ParameterTypeDescription
idintId of related sub-contact
namestringName of sub-contact
relationarrayRelation information
relation[id]intId of the relation
relation[description]string|nullDescription of relation
relation[description_contact]string|nullDescription of relation with contact
relation[mail]string|nullRelated email address
relation[phone]string|nullRelated phone nb
relation[phone_direct]string|nullRelated direct phone nb.
relation[mobile]string|nullRelated mobile nb.
relation[fax]string|nullRelated fax nb.
relation[priority]intlRelation priority
relation_categoryarrayRelation category
relation_category[id]int|nullCategory id
relation_category[name]string|nullCategory name in DE
relation_category[name_e]string|nullCategory name in EN
relation_category[name_i]string|nullCategory name in IT
relation_category[name_f]string|nullCategory name in FR

Response (Error):

ParameterTypeDescription
codeintegerAn error code
errorstringA message containing some information about the error 
errorsarrayList of errors devided by field in associative array {field_name:error message}
Request
curl -X GET https://public.brokerstar.biz/api/v3/insurance/227/sub-contact/228 --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'


Response (Success)
200 OK    
{
    "data": {
        "id": 228,
        "name": "Fiabane Roberto",
        "relation": {
			"id": 12,
            "description": "Kontaktperson",
            "description_contact": "Kontaktperson",
            "mail": "roberto.fiabane@visana.ch",
            "phone": "+41 32 626 26 52",
            "phone_direct": null,
            "mobile": null,
            "fax": null,
            "priority": 1
        },
        "relation_category": {
            "id": null,
            "name": null,
            "name_e": null,
            "name_i": null,
            "name_f": null
        }
    },
    "status": 200
}
Response (Error)
404 Not found
{
	"error": "Entity not found",
	"code": 404
}

Or one of