Menu
- Introduction;
- Using the API in Forms
- Creating an integration
- Create
- Retrieve
- Update
- Delete
- Search
- Further useful reading
Introduction
The Cross-Reference API (or ‘xref API’) allows you to add, change, and remove cross-references from a user profile. You will need an API key to use this functionality: to obtain one, please raise a support ticket and ask for the Cross-Reference API key (a separate one of which is required for test and live sites).
The default format for the Cross-Reference API is JSON.
You may also add, edit or delete a cross-reference from the Service interface.
Using the API in Forms
Creating an integration
- Go to the Integrations Manager and select "+ New Integration". This will load the integration designer.
- Select the Category you want the category to be in (optional).
- For organisational purposes we would suggest having a single category for all your xref API integrations.
- Give the integration a name;
- Select HTTP Integration/Lookup;
- Select Method as applicable from GET/POST/PUT/DELETE
The API function is determined by the url path and the required format (e.g. JSON/XML).
So for example, if you wish to use the search function the path would be:
<domain>/api/crossreference/reference/search/?apiKey=<Key_Value>
The default is for JSON, so for XML:
<domain>/api/crossreference/reference/search/xml?apiKey=<Key_Value>
Please note that before updating/deleting a cross-reference you will need to obtain the unique xref ID for the specified cross-reference using the search in Service Index. Specifically, to return the xref ID you will need to search using the UCRN against the type. Please note that all paths begin as follows: <domain>/api/crossreference/reference
| Type | Function | Path suffix | Payload |
|---|
| Create | Creates a new cross-reference for a contact. |
/create/<required format>
|
ucrn (mandatory): the UCRN of the contact.
reference (mandatory): the value of the cross-reference to store.
type (mandatory): the label for the type of cross-reference to be created.
start_date (optional): the date from which the cross-reference is active. Date format is (YYYY-MM-DD HH:MM:SS). If omitted it will default to the current date.
end_date (optional): the date until which the cross-reference is active. Date format is (YYYY-MM-DD HH:MM:SS). If omitted it will default to null.
comment (optional): a comment or note on the cross-reference. If omitted it will default to an empty string.
added_by: usually set to the UCRN of the user creating the cross-reference.
|
| Retrieve | Returns a list of the cross-references for a contact. | /list/<required format> | ucrn (mandatory) |
| Update | Updates an existing cross-reference. Any values will override existing values, whether they are set, not set, or empty, i.e. the mandatory parameters of the existing cross-reference must be replicated in full with the amendments included. | /update/<required format> |
id(mandatory): the primary id of the cross-reference to be updated - can be obtained using search xref below.
reference (optional):the value of the cross-reference to store. If omitted it will remain unchanged.
start_date (optional):the date from which the cross-reference is active, given in the format (YYYY-MM-DD HH:MM:SS). If omitted it will remain unchanged.
end_date (optional): the date until which the cross-reference is active, given in the format (YYYY-MM-DD HH:MM:SS). If omitted it will remain unchanged.
comment (optional): a comment or note on the cross-reference. If omitted it will remain unchanged.
deleted (optional): whether to delete or not (1 to delete or 0 to retain). If omitted it will be retained.
added_by (optional): usually set to the UCRN of the user creating the ref
|
| Delete | Deletes a cross-reference from the database. | /delete/<required format> | id (mandatory): the primary id of the cross-reference to be deleted - can be obtained using search xref below |
| Search | Returns a list of the cross-references for the current customer with the following parameters as constraints. | /search/<required format> |
ucrn: the UCRN of the cross-reference to search for.
reference: the reference to search for.
type: the type of cross-reference to search for.
type_id: the type_id of the cross-reference to search for.
start_date: the date from which the cross-reference is active (YYYY-MM-DD). If no start_date is specified, the date will default to null (0000-00-00).
end_date: the date until which the cross-reference is active (YYYY-MM-DD)
|