Identity API \ Link an identity to another user PHP SDK
Identity API Resources
| Resource/URI - Common | GET | POST | PUT | DELETE |
|---|---|---|---|---|
Identities
/identities.json
|
List all identities | – | – | – |
Identity
/identities/<identity_token>.json
|
Read identity details | – | – | Delete identity |
Identity
/identities/<identity_token>/link.json
|
– | – | ReLink identity | – |
Identity
/identities/<identity_token>/synchronize.json
|
– | – | Synchronize identity | – |
Identity
/identities/<identity_token>/contacts.json
|
Read identity contacts | – | – | – |
| Resource/URI - Provider Specific | GET | POST | PUT | DELETE |
|---|---|---|---|---|
Steam Games
/identities/<identity_token>/steam/games.json
|
List all Steam games | – | – | – |
Facebook Posts
/identities/<identity_token>/facebook/posts.json
|
List all Facebook posts | – | – | – |
Workflow
Request: the code to send to the API
Send a PUT request to the resource /identities/<identity_token>/link.json and include the structure below as POST data
in order to relink an existing identity to a different user. The <identity_token> has to be replaced by the unique token of an existing identity.
POST data to include in your request
{
"request":{
"user":{
"user_token": "#user_token#"
}
}
}
| Key | Description |
|---|---|
| * #user_token# |
The user_token of the new user to link the identity to. Example: 5360232a-d9ca-4433-8128-44a9e1d9cec3 |
Result: the code returned by the API
If the operation was successful, an updated list of the user's identities and a HTTP status code 200 will be returned.
In case of an error, an appropriate message body with further details on the error that occured will be included in the result.
Example Resultset
{
"response": {
"request": {
"date": "Tue, 02 May 2017 15:27:08 0200",
"resource": "/identities/b0ff3bde-608c-4209-9feb-f3971fd0aed8/link.json",
"status": {
"flag": "success",
"code": 200,
"info": "Your request has been processed successfully"
}
},
"result": {
"status": {
"flag": "success",
"code": 200,
"info": "The identity has successfully been linked to the specified user"
},
"data": {
"user":{
"user_token": "b456365a-d259-47c6-a72a-0f012f9dab84",
"identities": [
{
"identity_token": "a0c1665a-7631-4539-ac9c-b138a37354f7",
"provider": "paypal"
},
{
"identity_token": "431b4b29-27bc-4db9-8a68-c2f8abdb6bfe",
"provider": "foursquare"
},
{
"identity_token": "5da337eb-1f4e-4421-90f7-9683c1a92507",
"provider": "disqus"
},
{
"identity_token": "b0ff3bde-608c-4209-9feb-f3971fd0aed8",
"provider": "vkontakte"
}
]
}
}
}
}
}