Skip to main content

Contacts+: API

Find the Contacts+ API endpoints, operations, sample requests and webhook events for your APS tenancy.

The Contacts+ Application Programming Interface (API) lets you retrieve, add, update and delete client data in your APS tenancy. You can create people and organisations, then link them together using the Contacts+ relationship API. You'll need an authentication token from APS identity services to make requests.


Endpoints

Replace {tenantid} in each endpoint with your APS tenancy ID.


Client API operations

The Client API has the following operations.

Operation

Description

getClients

Retrieve a client list.

getPagedClients

Retrieve a client list with pagination.

createPerson

Add a new person.

createOrganisation

Add a new organisation.

createContactDetail

Add a new contact to an existing client.

createAddress

Add a new address to an existing client.

createTaxDetails

Add tax information, such as an Australian Business Number (ABN), to an existing client.

updateContactDetail

Update the contact details of an existing client.

updateAddress

Update the address details of an existing client.

updateTaxDetails

Update tax details, such as an ABN, of an existing client.


Relationship API operations

The Contacts+ relationship API has the following operations.

Operation

Description

getRelationshipTypes

Get the available relationship types.

getRelationships

Retrieve the relationships for a client.

getRelationship

Retrieve a relationship by its cloudId.

getRelationshipRule

Retrieve a single relationship rule for an entity type.

updateRelationship

Update a client relationship record.

deleteRelationship

Delete a client relationship record.

createRelationshipRule

Create a single client relationship rule.

deleteRelationshipRule

Delete a client relationship rule.

createRelationshipType

Create a client relationship type.

deleteRelationshipType

Delete a client relationship type.


Default entity IDs

When you add a new client through the API, you need to define the type of entity you're adding. Use one of the default entity IDs below. Every APS tenancy has these defaults.

Entity ID

Entity name

2245c3ce-61d4-4365-8485-1e37d6c7fbcf

Estate

2f5d8a57-f954-4407-87ac-6ccb2be3473d

Individual

52a076e8-19f5-4310-bb69-6aff28c49454

Government

53d1e1cb-0c3d-4f67-937d-86c7bc081b82

Superannuation Fund

60dc0af6-b65e-4362-9fae-8bc2a0a84741

Trust

7de9c65e-8eda-4685-8610-506ff3a0ba64

Māori Authority

7e4851a7-1019-478a-95cc-08d4ad0a6550

Trustee Company

9429845b-cc7a-4d7d-9bb1-4af1e59c382b

xDesktop - Individual

94df5714-5556-494f-9595-3808b30c1a03

xDesktop - Non-Individual

b47edf9c-3707-48f7-84c9-9895ac0952d2

Club


GraphQL playground

The Contacts+ API includes a GraphQL playground where you can test and explore queries and mutations. Find it at https://client-api.access-aps.com/clients/{tenantid} for client requests and https://client-api.access-aps.com/relationships/{tenantid} for relationship requests.

Before you use the playground, retrieve an authentication token from APS identity services. Add the token to each request as an authorizationtoken header.

⚠️Important: Requests will fail without the authorizationtoken header.

GraphQL schema

The latest schema is always available in the GraphQL playground. It lists all available queries and mutations.

  1. Open the playground for your tenancy.

  2. Click SCHEMA on the right.

Read this article alongside the schema, so you can check the fields available for each query and mutation.


Understanding GraphQL

GraphQL works differently from a traditional RESTful API. Instead of many endpoints that each return data set by the provider, GraphQL generally uses one or two endpoints. The software making the request defines exactly the data it wants in the response.

This means an application can retrieve data in one request. Without GraphQL, the same data might take three or four requests to different RESTful endpoints.

The following query requests client information from the Contacts+ API.

query  {    getClients(input:    {      isTerminated: false    }    )    {        __typename,        entityTypeId,        sortName,        contactDetailId,        attributesId,        marketingId,        mailName,        balanceMonth,        externalClientId,        code,        startDate,        endDate,        dateAdded,        familyGroupId,        headOfTheGroup,        debtorId,        taxDetailsId,        ... on Person {          firstName,          lastName,          middleName,          initials,          title,          salutation,          employer,          positionTitle        }        ... on Organisation{          tradingAs,          registeredName,          salutation        }        attributes{          cloudId,          dateOfBirth,          placeOfBirth          ranking,          staffId,          partnerId,          managerId        }      }    }

This query returns summary attributes and detailed information for both people and organisations in one response. A RESTful API would usually handle this with two separate endpoints.

The ... on Organisation and ... on Person sections tell the service which fields to return for each type of contact. If the contact is an organisation, the response includes the organisation fields. If the contact is a person, it includes the person fields. The service does this filtering before it completes the response.


Sample queries and mutations

Use these samples as a starting point in the GraphQL playground.

getClients

Retrieves a list of the clients in the APS tenancy.

query  {    getClients(input:    {      isTerminated: false    }    )    {        __typename,        entityTypeId,        sortName,        contactDetailId,        attributesId,        marketingId,        mailName,        balanceMonth,        externalClientId,        code,        startDate,        endDate,        dateAdded,        familyGroupId,        headOfTheGroup,        debtorId,        taxDetailsId,        ... on Person {          firstName,          lastName,          middleName,          initials,          title,          salutation,          employer,          positionTitle        }        ... on Organisation{          tradingAs,          registeredName,          salutation        }        attributes{          cloudId,          dateOfBirth,          placeOfBirth          ranking,          staffId,          partnerId,          managerId        },        taxDetails{          cloudId,          abnNumber,          tfnNumber        },        contactDetail{          fax,          primaryPhone,          streetAddress,          postalAddress,          registeredAddress,          otherPhone,          importantContactInfo,          primaryEmail,          otherEmail,          website        }  }  }

createPerson

Adds a new person to the Contacts+ API.

mutation  {  createPerson(input:  {  entityTypeId: "2f5d8a57-f954-4407-87ac-6ccb2be3473d"  firstName: "Firstname4",  lastName: "Lastname4",  sortName: "Lastname4,Firstname4"  }  )  {  cloudId  }  }

createOrganisation

Adds a new organisation to the Contacts+ API.

mutation  {  createOrganisation(input:  {  entityTypeId: "eb0e3b89-9d8b-4cf2-85ed-52f090461e80",  registeredName: "Company3"  }  )  {  cloudId  }  }

createContactDetail

Adds contact details to an existing client.

mutation   {   createContactDetail(input:   {   clientId: "41168154-f6ae-4d3d-a3c5-63330a481ec9",   primaryPhone: "32432423",   primaryEmail: "[email protected]",   otherPhone: "43325343"   }   )   {   cloudId   }   }

createAddress

Adds an address to a contact.

mutation   {   createAddress(input:   {   contactDetailId: "7dcf7d20-a4e2-41d9-b355-a641bdbc8a2d",   addressType: RegisteredOffice,   line1: "27 NewLane!",   line2: "NewSuburb",   country: "AUS"   }   )   {   cloudId   }   }

updateContactDetail

Updates an existing contact detail for a contact.

mutation   {   updateContactDetail(input:   {   clientId: "5c613691-5ab1-48b6-80cc-333f320ecfd5",   cloudId: "29e759f2-5bf3-4354-9e41-cc04ff763d86",   primaryPhone: null,   primaryEmail: "[email protected]"  }   )   {   correlationId   }   }

updateAddress

Updates an existing address for a contact.

mutation   {   updateAddress(input:   {   cloudId: "09cdd21f-07f9-4666-998e-fddbb158b4e8",   line1: "First Lane",   line2: "testSuburb"   }   )   {   correlationId   }   }

updateTaxDetails

Updates an existing set of tax details for a contact. The sample uses an Australian Business Number (ABN) and an Australian Company Number (ACN).

mutation  {  updateTaxDetails(input:  {  clientId: "41168154-f6ae-4d3d-a3c5-63330a481ec9",  cloudId: "bd5475ee-48e2-4820-84e3-b18710173709"  abnNumber: "83066088097",  acnArbnNumber: "83066088097"  }  )  {  correlationId  }  }

Webhooks

You can subscribe to data change notifications from APS Cloud. Use the subscription key provided to you by The Access Group.

⚠️Important: The user making a subscription request must have the root or admin role in APS Cloud for that tenant.

Use the public endpoints below to create, read, update and delete event subscriptions.

Create a subscription

This request creates a subscription for a tenant, subscription key, event and target URL combination. It returns a subscription ID, which you use to update or delete the subscription later.

POST /v1/{your tenant id}/subscriptions?subscription-key={your subscription key} HTTP/1.1  Host: webhooks.access-aps.com  authorizationtoken: eyJrx...  Content-Type: application/json    {       "eventType": "aps_organisation_updated",       "target_url": "https://webhook.site/73ae7164-3743-405f-8d62-1c03827500f7"   }

Read subscriptions

Use this request to retrieve the existing subscriptions for a tenant and subscription key.

GET /v1/{your tenant id}/subscriptions?subscription-key={your subscription key} HTTP/1.1  Host: webhooks.access-aps.com  authorizationtoken: eyJrx...  Content-Type: application/json    {      "list": [          {              "eventType": "aps_organisation_updated",              "subscriptionId": "0cbc9cf0-4a75-11ed-824f-4f2f6f39a636",              "targetUrl": "https://webhook.site/73ae7164-3743-405f-8d62-1c03827500f7",              "status": "enabled"          }      ]  }

To retrieve subscriptions for one event type, add the event type to the request.

GET /v1/{your tenant id}/subscriptions/events/{event type}?subscription-key={your subscription key} HTTP/1.1  Host: webhooks.access-aps.com  authorizationtoken: eyJrx...  Content-Type: application/json    {      "list": [          {              "eventType": "aps_organisation_updated",              "subscriptionId": "0cbc9cf0-4a75-11ed-824f-4f2f6f39a636",              "targetUrl": "https://webhook.site/73ae7164-3743-405f-8d62-1c03827500f7",              "status": "enabled"          }      ]  }

Update a subscription

Use this request to change one or more of eventType, targetUrl or status on an existing subscription in a single request.

PUT /v1/{your tenant id}/subscriptions/{subscription id} HTTP/1.1  Host: webhooks.access-aps.com  authorizationtoken: eyJrx...  Content-Type: application/json    {      "eventType": "aps_organisation_created",      "targetUrl": "https://webhook.site/36e249a0-f417-4547-b636-544445bdb4c7",      "status": "disabled"  }

Delete a subscription

Use this request to delete an existing subscription.

DELETE /webhooks/v1/{your tenant id}/subscriptions/{subscription id} HTTP/1.1  Host: webhooks.access-aps.com  authorizationtoken: Bearer eyJra...

Additional notes

  • Authentication uses the same token, and works the same way, as for the Client API.

  • The resource_url in a notification is relative, for example {tenantid}/organisation/{clientid}. You can't use it directly with the GraphQL API to fetch changes. Extract the entity ID from it and use that ID in the relevant GraphQL query.

  • The same payload is returned for all events, including _created, _updated and _deleted events. Your notification consumer must fetch the actual data change. For a deleted record, the fetch returns a 404.

  • You can add external information to the callback URL to customise how your system processes each event. For example, you can pass state through the subscription URL.

{       "eventType": "aps_client_deleted",       "target_url": "https://webhook.site/hook_id/bgl_tenant_id/aps_tenant_id/some_more_custom_state/client_deleted"   }

🤓Tip: You can test webhooks with Postman and Webhook.site.


Supported APS events

You can subscribe to the following events.

  • aps_person_created

  • aps_person_updated

  • aps_organisation_updated

  • aps_organisation_created

  • aps_address_created

  • aps_marketing_details_created

  • aps_marketing_details_updated

  • aps_attributes_created

  • aps_address_updated

  • aps_attributes_updated

  • aps_contact_detail_created

  • aps_contact_detail_updated

  • aps_primary_industry_created

  • aps_primary_industry_updated

  • aps_primary_industry_deleted

  • aps_tax_details_created

  • aps_tax_details_updated

  • aps_security_group_created

  • aps_security_group_updated

  • aps_security_group_deleted

  • aps_client_security_group_created

  • aps_client_security_group_deleted

  • aps_client_security_group_updated

  • aps_client_deleted

  • aps_relationship_created

  • aps_relationship_deleted

  • aps_relationship_updated

  • aps_relationship_type_created

  • aps_relationship_type_deleted

  • aps_relationship_rule_created

  • aps_relationship_rule_deleted

  • aps_user_security_groups_updated

  • aps_user_security_group_created

  • aps_user_security_group_deleted


Did this answer your question?