Attach
Attach an identity to the current profile.
Service | Operation |
---|---|
identity | ATTACH |
Method Parameters
Parameter | Description |
---|---|
externalId | User ID |
authenticationToken | Password or client side token |
authenticationType | Type of authentication. Full list of types can be found here. |
externalAuthName | The name of the external authentication mechanism (optional, used for custom authentication types) |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var externalId = "email@email.com";
var authenticationToken = "email@email.com";
var authenticationType = "Email";
var externalAuthName = "";
var identityProxy = bridge.getIdentityServiceProxy();
var postResult = identityProxy.attach(externalId, authenticationToken, authenticationType, externalAuthName);
if (postResult.status == 200) {
// Success!
}
{
"service": "identity",
"operation": "ATTACH",
"data": {
"externalId": "email@email.com",
"authenticationToken": "email@email.com",
"authenticationType": "Email",
"externalAuthName": ""
}
}
JSON Response
{
"status" : 200,
"data" : null
}
Common Error Code
Status Codes
Code | Name | Description |
---|---|---|
40211 | DUPLICATE_IDENTITY_TYPE | Returned when trying to attach an identity type that already exists for that profile. For instance you can have only one Facebook identity for a profile. |
40212 | MERGE_PROFILES | Returned when trying to attach an identity type that would result in two profiles being merged into one (for instance an anonymous account and a Facebook account). |