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 |
You need the latest version of the PHP SDK for this, located here: https://github.com/wcealliance/php-sdk
Request example
$API->editUserAccreditor('adrian.perez@wcea.education', 1, array( "Date of birth" => "01 Jan 1988" ));
Output Example
array( "id" => 1, "name" => "Accreditation board of Pharmacists", "abbreviation" => "ABP", "user_fields" => array( "Date of birth" => array( "type" => "date", "default_value" => "", "required" => true, "user_value" => "01 January 1988", ) ) )