Difference between revisions of "API: External Referrals"
Line 9: | Line 9: | ||
---- | ---- | ||
− | Multiple people can be sent in one PUT, for instance a carer and their cared-fors, or a client and their social worker. In both cases, it may be useful to specify the relationships between them. The key-values for the relationship can be found in the dictionary. In the example below, Alice is the mother (relationship 5 in our demo system) of Bob and Charlie. Bob and Charlie are the sons (relationship 8) of Alice. | + | Multiple people can be sent in one PUT, for instance a carer and their cared-fors, or a client and their social worker. In both cases, it may be useful to specify the relationships between them. The key-values for the relationship can be found in the dictionary. In the example below, Alice is the mother (relationship 5 in our demo system) of Bob and Charlie. Bob and Charlie are the sons (relationship 8) of Alice. Bob and Charlie are brother (relationship 15). The people are referenced by a zero-indexed list, e.g. Alice is 0, with a relationship to 1 (Bob) and 2 (Charlie). |
[ | [ | ||
Line 27: | Line 27: | ||
'relationships' => [ | 'relationships' => [ | ||
0 => 8 | 0 => 8 | ||
+ | 2 => 15 | ||
] | ] | ||
], | ], | ||
Line 35: | Line 36: | ||
'relationships' => [ | 'relationships' => [ | ||
0 => 8 | 0 => 8 | ||
+ | 1 => 15 | ||
] | ] | ||
] | ] | ||
] | ] |
Revision as of 15:36, 17 February 2020
External Referrals are an alterative to making clients and referrals directly: they are held in a staging area, to be imported or rejected by the system administrator. This has the advantage that the caller of the API does not need to check whether the client they have is already known - the administrator can use the search tools in the GUI to prevent duplicates.
[PUT] https://api.dizions.co.uk/v2/external_referral
The org_type_id, surname and description fields must be passed as a minimum. Most optional fields are any field from the client endpoint, with 1 notable exception: project. Including project will save the user who processes the referrals from having to select it each time they import.
Multiple people can be sent in one PUT, for instance a carer and their cared-fors, or a client and their social worker. In both cases, it may be useful to specify the relationships between them. The key-values for the relationship can be found in the dictionary. In the example below, Alice is the mother (relationship 5 in our demo system) of Bob and Charlie. Bob and Charlie are the sons (relationship 8) of Alice. Bob and Charlie are brother (relationship 15). The people are referenced by a zero-indexed list, e.g. Alice is 0, with a relationship to 1 (Bob) and 2 (Charlie).
[
[ 'first_name' => 'Alice', 'surname' => 'Smith', 'org_type_id' => '1', 'relationships' => [ 1 => 5 2 => 5 ] ], [ 'first_name' => 'Bob', 'surname' => 'Smith', 'org_type_id' => '2', 'relationships' => [ 0 => 8 2 => 15 ] ], [ 'first_name' => 'Charlie', 'surname' => 'Smith', 'org_type_id' => '2', 'relationships' => [ 0 => 8 1 => 15 ] ]
]