Difference between revisions of "API external referrals"

From Charitylog Manual
Jump to: navigation, search
 
(4 intermediate revisions by one other user not shown)
Line 3: Line 3:
 
These are referrals collected externally, e.g. a self-referral form on your website.
 
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 [[How_to_order_a_Web_Referral_Form|Web forms]].
+
If you want an all-in-one solution, where we create the form, and call this API for you, see our [[How_to_order_a_Web_Referral_Form|Web forms]]. If you're unsure about using this option, please call our support team to discuss.
 
If you want your developers to create your form, or if the referrals are coming from another application, they'll need this endpoint.
 
If you want your developers to create your form, or if the referrals are coming from another application, they'll need this endpoint.
  
Line 23: Line 23:
 
If you want the user who imports the referral to decide, omit the "project". Any other fields from the /clients endpoint can be included, see /clients/selectable_fields
 
If you want the user who imports the referral to decide, omit the "project". Any other fields from the /clients endpoint can be included, see /clients/selectable_fields
  
If you are collecting external referrals from multiple sources, e.g. a volunteer recruitment form and a client enquiry form, you can also specify a "source" attribute, so that you can distinguish them. This would typically be "1" if you only have one source. If specifying a source, you must also specify a "referral_role", which is used by the External Referral Manager in the web application to display different fields for different people. For example, referral_role 1 might be a carer (for whom you collect a lot of details) and referral_role 2 might be one or more cared-fors (for whom you only collect basic details).
+
If you are collecting external referrals from multiple sources, e.g. a volunteer recruitment form and a client enquiry form, you can also specify a "source" attribute, so that you can distinguish them. This would typically be "1" if you only have one source. If specifying a source, you must also specify a "referral_role", which is used by the External Referral Manager in the web application to display different fields for different people. For example, referral_role 1 might be a cared-for (for whom you collect a lot of details) and referral_role 2 might be one or more carers (for whom you only collect basic details).
  
A fuller example might look like:
+
Here is an example of Alice and her family carers:
 +
- Alice is org type 7 (service user) and has a referral_role of 1 (cared-for)
 +
- Her husband Barry has an org type of 9 (family member) and a referral role of 2 (carer)
 +
- Their children Catherine and David are also org type 9 (family member), and a referral role of 3 (child)
  
 
  [
 
  [
Line 31: Line 34:
 
   "source": "1",
 
   "source": "1",
 
   "referral_role": "1",
 
   "referral_role": "1",
 +
  "org_type_id": 7,
 
   "first_name": "Alice",
 
   "first_name": "Alice",
 
   "surname": "Smith",
 
   "surname": "Smith",
 
   "ethnicity": "35",
 
   "ethnicity": "35",
 +
  "email": "asmith@example.com",
 +
  "telephone": "01111 111111",
 
   "address1": "10 High Street",
 
   "address1": "10 High Street",
 
   "postcode": "HR9 7US",
 
   "postcode": "HR9 7US",
  "org_type_id": 1,
+
   "description": "Wants help accessing respite care",
   "description": "Wants help with getting her children to socialise more",
+
   "project": 7
   "project": 7,
 
 
   },
 
   },
 
   {
 
   {
  "source": "1",
 
 
   "referral_role": "2",
 
   "referral_role": "2",
   "first_name": "Beatrice",
+
  "org_type_id": 9,
 +
   "first_name": "Barry",
 
   "surname": "Smith",
 
   "surname": "Smith",
   "org_type_id": 1,
+
  "email": "bsmith@example.com",
 +
  "telephone": "02222 222222"
 +
  },
 +
  {
 +
  "referral_role": "3",
 +
   "org_type_id": 9,
 +
  "first_name": "Catherine",
 +
  "surname": "Smith"
 
   },
 
   },
 
   {
 
   {
   "source": "1",
+
   "referral_role": "3",
   "referral_role": "2",
+
   "org_type_id": 9,
   "first_name": "Carl",
+
   "first_name": "David",
 
   "surname": "Smith",
 
   "surname": "Smith",
  "org_type_id": 1,
 
 
   }
 
   }
 
  ]
 
  ]

Latest revision as of 12:08, 15 November 2024

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're unsure about using this option, please call our support team to discuss. 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, see /clients/selectable_fields

If you are collecting external referrals from multiple sources, e.g. a volunteer recruitment form and a client enquiry form, you can also specify a "source" attribute, so that you can distinguish them. This would typically be "1" if you only have one source. If specifying a source, you must also specify a "referral_role", which is used by the External Referral Manager in the web application to display different fields for different people. For example, referral_role 1 might be a cared-for (for whom you collect a lot of details) and referral_role 2 might be one or more carers (for whom you only collect basic details).

Here is an example of Alice and her family carers:

- Alice is org type 7 (service user) and has a referral_role of 1 (cared-for)
- Her husband Barry has an org type of 9 (family member) and a referral role of 2 (carer)
- Their children Catherine and David are also org type 9 (family member), and a referral role of 3 (child)
[
 {
  "source": "1",
  "referral_role": "1",
  "org_type_id": 7,
  "first_name": "Alice",
  "surname": "Smith",
  "ethnicity": "35",
  "email": "asmith@example.com",
  "telephone": "01111 111111",
  "address1": "10 High Street",
  "postcode": "HR9 7US",
  "description": "Wants help accessing respite care",
  "project": 7
 },
 {
  "referral_role": "2",
  "org_type_id": 9,
  "first_name": "Barry",
  "surname": "Smith",
  "email": "bsmith@example.com",
  "telephone": "02222 222222"
 },
 {
  "referral_role": "3",
  "org_type_id": 9,
  "first_name": "Catherine",
  "surname": "Smith"
 },
 {
  "referral_role": "3",
  "org_type_id": 9,
  "first_name": "David",
  "surname": "Smith",
 }
]