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.
Relationship API: https://client-api.access-aps.com/relationships/{tenantid}
Client API operations
The Client API has the following operations.
Operation | Description |
| Retrieve a client list. |
| Retrieve a client list with pagination. |
| Add a new person. |
| Add a new organisation. |
| Add a new contact to an existing client. |
| Add a new address to an existing client. |
| Add tax information, such as an Australian Business Number (ABN), to an existing client. |
| Update the contact details of an existing client. |
| Update the address details of an existing client. |
| Update tax details, such as an ABN, of an existing client. |
Relationship API operations
The Contacts+ relationship API has the following operations.
Operation | Description |
| Get the available relationship types. |
| Retrieve the relationships for a client. |
| Retrieve a relationship by its cloudId. |
| Retrieve a single relationship rule for an entity type. |
| Update a client relationship record. |
| Delete a client relationship record. |
| Create a single client relationship rule. |
| Delete a client relationship rule. |
| Create a client relationship type. |
| 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 |
| Estate |
| Individual |
| Government |
| Superannuation Fund |
| Trust |
| Māori Authority |
| Trustee Company |
| xDesktop - Individual |
| xDesktop - Non-Individual |
| 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.
Open the playground for your tenancy.
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_urlin 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,_updatedand_deletedevents. 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_createdaps_person_updatedaps_organisation_updatedaps_organisation_createdaps_address_createdaps_marketing_details_createdaps_marketing_details_updatedaps_attributes_createdaps_address_updatedaps_attributes_updatedaps_contact_detail_createdaps_contact_detail_updatedaps_primary_industry_createdaps_primary_industry_updatedaps_primary_industry_deletedaps_tax_details_createdaps_tax_details_updatedaps_security_group_createdaps_security_group_updatedaps_security_group_deletedaps_client_security_group_createdaps_client_security_group_deletedaps_client_security_group_updatedaps_client_deletedaps_relationship_createdaps_relationship_deletedaps_relationship_updatedaps_relationship_type_createdaps_relationship_type_deletedaps_relationship_rule_createdaps_relationship_rule_deletedaps_user_security_groups_updatedaps_user_security_group_createdaps_user_security_group_deleted
