Edits or adds accreditors to the specified user's profile.
Request
- HTTP Verb: PUT / POST
- URI: /user/{user_id}/accreditor/{id}
Query Parameters
- user_id: user identifier. It could be either user id, user email or custom member_id.
- id: accreditor id.
PUT / POST Parameters
These parameters are defined by what that particular accreditor's user_fields are.
user_fields can be viewed here: Get accreditor
Both PUT and POST requests behave the same way. If an accreditor is in a user's profile it will be updated. If it doesn't exist in the profile, it will be added.
The success of this operation depends on the accreditor user_fields.
If a particular user_field is required: true, and the field is not set, the operation will fail with an error message indicationg why it failed.
Any given user_field contains 4 keys:
| type | There are 3 types: text, multiline-text and date. All 3 are quite flexible in what they accept, however with the date field please set a readable date, for example 02-02-2015 or 21 Mar 2015 |
|---|---|
| default_value | Default value if not filled in |
| required | Whether this field is required. If a field is required, the operation will fail with an error if it is not set |
| user_value | The current value of this field in the user's profile |
Request example
curl -X PUT \ -H "Request-Time: Wed, 11 Dec 2013 15:38:32 +0000" \ -H "Api-Key: 78b47a40f93378a6a487919edea6e92c" \ -H "Signature: 18cfbb5a9bd71f3d4475c8758b9c1281819f954468842737fbf16c72b4198cbe" \ -d "Date of birth=01 Jan 1988" \ http://wceaapi.org/v1.1/user/adrian.perez@wcea.education/accreditor/1
Output Example
{
"_meta": {
...
},
"records": {
"id": 1,
"name": "Accreditation board of Pharmacists",
"abbreviation": "ABP",
"user_fields": {
"Date of birth": {
"type": "date",
"default_value": "",
"required": true,
"user_value": "01 January 1988",
}
}
}
}
