API: Extension Databases

From Charitylog Manual
Revision as of 09:56, 5 August 2019 by Rduheaume (talk | contribs)
Jump to: navigation, search
Helpheader small.png

Single Record Extension Databases

As mentioned previously, 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 front end, 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.