API due contacts

From Charitylog Manual
Jump to: navigation, search

Go to API overview

These are outstanding actions that typically make up the Action List in the web application.

Reading

A list of selectable fields can be found using:

[GET] https://api.dizions.co.uk/v2/due_contacts/selectable_fields

A list of fields available as metrics can be found using:

[GET] https://api.dizions.co.uk/v2/due_contacts/metrics

Typical filters are dates, projects and user

[GET] https://api.dizions.co.uk/v2/due_contacts/project/3;5;7/date/2023-01-31,2023-12-31/user/4;6;8

For a full list of filters, use:

[GET] https://api.dizions.co.uk/v2/due_contacts/filterable_fields

Writing

Typically, there are 3 things you might want to do with a due contact:


1) Create a due contact against an existing referral. This is the equivalent of the bottom half of the Record a Contact page in the web application.

[POST] https://api.dizions.co.uk/v2/due_contacts/referral/127

Add values for the keys: user, start_date, end_date and description to the body. Note that as an outstanding action, the start_date and end_date refer to the planned start and end time of the action. This will return the id of the newly-created due_contact.


2) Edit an existing due contact, e.g. if you want to reassign the action to a different user. This is the equivalent of editing the left hand side of the referral edit page in the web application.

[POST] https://api.dizions.co.uk/v2/due_contacts/456

The body must contain at least one of the following keys: user, start_date, end_date and description.


3) Complete the due contact once the contact has taken place. This is the equivalent of pressing the Update buttom in the web application.

[POST] https://api.dizions.co.uk/v2/done_contacts/456

The body must contain at least one of the following keys: user, stage, start_date, end_date and description. Note that this call is made to the done_contact endpoint, using same id. These keys therefore represent the user and date that the outstanding action was completed.