Difference between revisions of "API due contacts"

From Charitylog Manual
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
These are outstanding actions that typically make up the Action List in the web application.
 
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<nowiki/>://api.dizions.co.uk/v2/due_contacts/selectable_fields
 +
 +
A list of fields available as metrics can be found using:
 +
[GET] https<nowiki/>://api.dizions.co.uk/v2/due_contacts/metrics
 +
 +
Typical filters are dates, projects and user
 +
[GET] https<nowiki/>://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<nowiki/>://api.dizions.co.uk/v2/due_contacts/filterable_fields
 +
 +
==Writing==
 
Typically, there are 3 things you might want to do with a due contact:
 
Typically, there are 3 things you might want to do with a due contact:
  
Line 8: Line 23:
 
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.
 
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<nowiki/>://api.dizions.co.uk/due_contacts/referral/127
+
  [POST] https<nowiki/>://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.
 
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.
Line 15: Line 30:
 
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.
 
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<nowiki/>://api.dizions.co.uk/due_contacts/456
+
  [POST] https<nowiki/>://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.
 
The body must contain at least one of the following keys: user, start_date, end_date and description.
Line 22: Line 37:
 
3) Complete the due contact once the contact has taken place. This is the equivalent of pressing the Update buttom in the web application.
 
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<nowiki/>://api.dizions.co.uk/done_contacts/456
+
  [POST] https<nowiki/>://api.dizions.co.uk/v2/done_contacts/456
  
The body must contain at least one of the following keys: user, 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.
+
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.

Latest revision as of 09:15, 17 July 2023

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.