API: Linked contacts (relations)

Relation list

JWT Authorisation

GET /api/v3/linked-contacts

Request parameter:

No Request parameter

API: _ Default behavior #List defaults

Filtering parameters:

Parameter

Type

IN

Example

Description

contactintQUERYfilters[contact]=4Filtering by main contact id = value

Response data:

Metadata: object.

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

Data:  object.data[array]

ParameterOut TypeIn TypeDescription
idinteger
Relation id
main_contactarrayintMain API: Contact data
related_contactarrayintRelated API: Contact data 
relation_to_main_contactstring|nullstring|nullRelation related contact to main contact description
relation_to_related_contactstring|nullstring|nullRelation main contact to related contact description
priorityint(0->100)
Priority (sorting) 0-100

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}

API: _ Default behavior#Authentication defaults 

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


Response (Success)
200 OK  {
    "count": "2",
    "data": [
        {
            "main_contact": {
                "name": "Allianz Suisse Versicherungs-Gesellschaft AG",
                "name_1": "Allianz Suisse",
                "name_2": "Versicherungs-Gesellschaft AG",
                "id": 4
            },
            "related_contact": {
                "name": "AXA Winterthur ",
                "name_1": "AXA Winterthur",
                "name_2": null,
                "id": 6
            },
            "relation_to_main_contact": "Brother",
            "relation_to_related_contact": "Father",
            "id": 3,
            "priority": 55
        },
        {
            "main_contact": {
                "name": "Allianz Suisse Versicherungs-Gesellschaft AG",
                "name_1": "Allianz Suisse",
                "name_2": "Versicherungs-Gesellschaft AG",
                "id": 4
            },
            "related_contact": {
                "name": "Allianz Suisse Lebens- Versicherungs-Gesellschaft AG",
                "name_1": "Allianz Suisse Lebens-",
                "name_2": "Versicherungs-Gesellschaft AG",
                "id": 5
            },
            "relation_to_main_contact": "Brother",
            "relation_to_related_contact": "Father",
            "id": 4,
            "priority": 55
        }
    ],
    "status": 200
}

Or one of 

Single Relation

JWT Authorisation

GET /api/v3/linked-contacts/{id}

Request parameter:

ParameterTypeInDescription
idinturlid of requested relation

Response data:

Metadata: object.

ParameterTypeDescription
statusintResponse status (same as in http code)

Data:  object.data

ParameterOut TypeIn TypeDescription
All fields from Single 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/linked-contacts/2 --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'


Response (Success)
200 OK   {
    "data": {
        "main_contact": {
            "name": "Allianz Suisse Versicherungs-Gesellschaft AG",
            "name_1": "Allianz Suisse",
            "name_2": "Versicherungs-Gesellschaft AG",
            "id": 4
        },
        "related_contact": {
            "name": "Allianz Suisse Lebens- Versicherungs-Gesellschaft AG",
            "name_1": "Allianz Suisse Lebens-",
            "name_2": "Versicherungs-Gesellschaft AG",
            "id": 5
        },
        "relation_to_main_contact": "sese",
        "relation_to_related_contact": "seses",
        "id": 2,
        "priority": 99
    },
    "status": 200
}
Response (Error)
404 Not found
{
	"error": "Entity not found",
	"code": 404
}
Response (Error)
403 Forbidden
{
	"error": "You have no access to contact id:123",
	"code": 403
}

Or one of 

Relation remove

JWT Authorisation

DELETE /api/v3/linked-contacts/{id}

Request parameter:

ParameterTypeInDescription
idinturlid of requested relation

Response data:

Metadata: object.

ParameterTypeDescription
statusintResponse status (same as in http code)


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 DELETE https://public.brokerstar.biz/api/v3/linked-contacts/16448   --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Success)
200 OK   
{
	"status":200
}
Response (Error)
404 Not found
{
	"error": "Entity not found",
	"code": 404
}
Response (Error)
403 Forbidden
{
	"error": "You have no access to contact id:123",
	"code": 403
}

Related pages