Difference between revisions of "API: Extension Databases"
Line 11: | Line 11: | ||
Multiple record extension databases work as their own entity. They can be accessed in the API by a combination of their name and ID. Convert the name to lowercase, and replace spaces with underscores. Then separate the name and ID with an underscore. For example, this end point that gets all records for extension database 13, called Staff Disciplinary: | Multiple record extension databases work as their own entity. They can be accessed in the API by a combination of their name and ID. Convert the name to lowercase, and replace spaces with underscores. Then separate the name and ID with an underscore. For example, this end point that gets all records for extension database 13, called Staff Disciplinary: | ||
− | [GET] https://api.dizions.co.uk/v2/extension_database/staff_disciplinary_13 | + | [GET] https<nowiki/>://api.dizions.co.uk/v2/extension_database/staff_disciplinary_13 |
You can also specify which fields you want to select, to make things more efficient. Extension database records can be filtered in the same way as other requests, to get all results for a particular referral you can do this: | You can also specify which fields you want to select, to make things more efficient. Extension database records can be filtered in the same way as other requests, to get all results for a particular referral you can do this: | ||
− | [GET] https://api.dizions.co.uk/v2/extension_database/wellcheck_notes_9/referral/2289 | + | [GET] https<nowiki/>://api.dizions.co.uk/v2/extension_database/wellcheck_notes_9/referral/2289 |
Multiple Record Extension Databases [PUT] | Multiple Record Extension Databases [PUT] | ||
Line 21: | Line 21: | ||
To create a new record you need to do a [PUT] request. | To create a new record you need to do a [PUT] request. | ||
− | [PUT] https://api.dizions.co.uk/v2/extension_database/staff_disciplinary_13 | + | [PUT] https<nowiki/>://api.dizions.co.uk/v2/extension_database/staff_disciplinary_13 |
Then add the body: | Then add the body: | ||
Line 35: | Line 35: | ||
To update a record you also need to supply the ID: | To update a record you also need to supply the ID: | ||
− | [POST] https://api.dizions.co.uk/v2/extension_database/wellcheck_notes_9/id/17 | + | [POST] https<nowiki/>://api.dizions.co.uk/v2/extension_database/wellcheck_notes_9/id/17 |
Then add the POST body in the same way as a PUT request. | Then add the POST body in the same way as a PUT request. | ||
=Dictionaries= | =Dictionaries= | ||
For Extension Database which are "Select From Option List" or "Radio buttons", there is a dictionary for each field, using the collaboration name displayed on each Extension Database Field: | For Extension Database which are "Select From Option List" or "Radio buttons", there is a dictionary for each field, using the collaboration name displayed on each Extension Database Field: | ||
− | https://api.dizions.co.uk/v2/dictionary/extension_database/INSERT_API_COLLABORATION_NAME_HERE | + | https<nowiki/>://api.dizions.co.uk/v2/dictionary/extension_database/INSERT_API_COLLABORATION_NAME_HERE |
---- | ---- |
Revision as of 13:01, 13 May 2020
Contents
Single Record Extension Databases
For referrals and clients you can select single record extension database data, or filter by these values. To expose these fields to the API you need to edit that field in the web application, setting "Allow collaborator API access?" to "Yes" and choosing a suitable Name to share with collaborators. You can then reference that extension database field by the collaborator name.
Multiple Record Extension Databases [GET]
Multiple record extension databases work as their own entity. They can be accessed in the API by a combination of their name and ID. Convert the name to lowercase, and replace spaces with underscores. Then separate the name and ID with an underscore. For example, this end point that gets all records for extension database 13, called Staff Disciplinary:
[GET] https://api.dizions.co.uk/v2/extension_database/staff_disciplinary_13
You can also specify which fields you want to select, to make things more efficient. Extension database records can be filtered in the same way as other requests, to get all results for a particular referral you can do this:
[GET] https://api.dizions.co.uk/v2/extension_database/wellcheck_notes_9/referral/2289
Multiple Record Extension Databases [PUT]
To create a new record you need to do a [PUT] request.
[PUT] https://api.dizions.co.uk/v2/extension_database/staff_disciplinary_13
Then add the body:
referral 2289
date_43 2018-11-08
The ID of the new record will be returned.
Multiple Record Extension Databases [POST]
To update a record you also need to supply the ID:
[POST] https://api.dizions.co.uk/v2/extension_database/wellcheck_notes_9/id/17 Then add the POST body in the same way as a PUT request.
Dictionaries
For Extension Database which are "Select From Option List" or "Radio buttons", there is a dictionary for each field, using the collaboration name displayed on each Extension Database Field: https://api.dizions.co.uk/v2/dictionary/extension_database/INSERT_API_COLLABORATION_NAME_HERE