Create a social association
info
This operation requires that the user is the same or has the admin role.
HTTP Request
POST /api/v2/user/provider/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
user_id | body | integer | true | The user id |
ext_id | body | string | true | A unique external id identifying the user |
provider | body | string | true | The external provider of the ext_id |
profile_url | body | string | false | An optional url to the social profile; only for providers other than external |
metadata | body | string | false | An optional json only for the external provider |
show_in_profile | body | bool | false | Default false. An optional flag to indicate if the social association can be showed in the user profile. Provider must not be 'external' |
Example Request
- JavaScript
- Bash
const inputBody = '{
"user_id": "integer",
"ext_id": "string",
"provider": "string"
}';
const headers = {
'Authorization':'Bearer {access_token}',
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v2/user/provider/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/user/provider/ \
-H 'Authorization: Bearer {access_token}'
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
-d '{
"user_id": "integer",
"ext_id": "string",
"provider": "string"
}'
Responses
Status | Meaning | Schema |
---|---|---|
201 | Created | User External Provider |
Example responses
- 201
{
"user_id": "integer",
"provider": "string",
"ext_id": "integer",
"profile_url": "string(uri)",
"show_in_profile": "boolean"
}