Difference between revisions of "API external referrals"

From Charitylog Manual
Jump to: navigation, search
Line 29: Line 29:
 
  [
 
  [
 
   {
 
   {
 +
  "field_display_key": "1",
 
   "first_name": "Alice",
 
   "first_name": "Alice",
  "field_display_key": "1",
 
 
   "surname": "Smith",
 
   "surname": "Smith",
 
   "ethnicity": "35",
 
   "ethnicity": "35",

Revision as of 16:39, 20 February 2023

Go to API overview

These are referrals collected externally, e.g. a self-referral form on your website.

If you want an all-in-one solution, where we create the form, and call this API for you, see our Web forms. If you want your developers to create your form, or if the referrals are coming from another application, they'll need this endpoint.

As a minimum, you need a PUT to:

[PUT] https://api.dizions.co.uk/v2/external_referral

and a body encoded as x-www-form-urlencoded containing at least the attributes below:

[
 {
  "first_name": "Alice",
  "surname": "Smith",
  "org_type_id": 1,
 }
]

If you want the person doing the importing to also make a referral, specify a "description" attribute, e.g. "Wants help with getting out and about more".

When creating a referral, you may want to include a "project" attribute, which will force the referral to be created in that project when it's imported. If you want the user who imports the referral to decide, omit the "project". Any other fields from the /clients endpoint can be included.

If you are collecting external referrals from multiple sources, you can also specify a field_display_key, so that you can distinguish them. This would typically be "1" if you only have one source.

A fuller example might look like:

[
 {
  "field_display_key": "1",
  "first_name": "Alice",
  "surname": "Smith",
  "ethnicity": "35",
  "address1": "10 High Street",
  "postcode": "HR9 7US",
  "org_type_id": 1,
  "description": "Wants help with getting out and about more",
  "project": 7,
 }
]