Skip to main content

Create a social association

info

This operation requires authentication and the user must be the same or must have the admin role.

HTTP Request

POST /api/v2/user/provider/

Parameters

NameInTypeRequiredDescription
user_idbodyintegertrueThe user id
ext_idbodystringtrueA unique external id identifying the user
providerbodystringtrueThe external provider of the ext_id
profile_urlbodystringfalseAn optional url to the social profile; only for providers other than external
metadatabodystringfalseAn optional json only for the external provider
show_in_profilebodyboolfalseDefault false. An optional flag to indicate if the social association can be showed in the user profile. Provider must not be 'external'

Example Request

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);
});

Responses

StatusMeaningSchema
201CreatedUser External Provider

Example responses

{
"user_id": "integer",
"provider": "string",
"ext_id": "integer",
"profile_url": "string(uri)",
"show_in_profile": "boolean"
}