Chuyển tới nội dung chính

Set User Mapping

Update the mapping of a user account.

POST odata/_userMappings
--x-appvity-channelId: [ChannelID]
--x-appvity-teamid: [TeamID]
--Cookie: graphNodeCookie=[ID]
--data-binary [UserObject] |

URL Endpoint

odata/_userMappings

Method

POST.

Parameters

Do not supply OData Filter syntax.

Request Header

--x-appvity-channelId: [ChannelID]
--x-appvity-teamid: [TeamID]
--Cookie: graphNodeCookie=[ID]

Body

This endpoint needs the following information:

{
"user365": "[UserO365]",
"source": "[SourceCode]",
"username": "[UserName]",
"localId": "5e61bd889e653912e84c1aa8",
"displayName": "Oliver Neal",
"sourceId": "oliver@anadea.com",
"email": "oliver@anadea.com",
"projectHostname": "[HostName]",
"projectId": "[SourceID]"
}

Example

{
"user365": "oliver@anadea.com",
"source": "Microsoft.Vsts",
"username": "oliver@anadea.com",
"localId": "5e61bd889e653912e84c1aa8",
"displayName": "Oliver Neal",
"sourceId": "oliver@anadea.com",
"email": "oliver@anadea.com",
"projectHostname": "https://anadea.visualstudio.com",
"projectId": "5bda7c8743137b5e4d31d531"
}

Response


{
"@odata.context": "https://schema.appvity.com/odata/$metadata#_userMappings/$entity",
"@odata.editLink": "https://schema.appvity.com/odata/_userMappings('5f69a4314d596392f570e8d6')",
"@odata.id": "https://schema.appvity.com/odata/_userMappings('5f69a4314d596392f570e8d6')",
"user365": "oliver@anadea.com",
"source": "Microsoft.Vsts",
"username": "oliver@anadea.com",
"localId": "5e61bd889e653912e84c1aa8",
"displayName": "Oliver Neal",
"sourceId": "oliver@anadea.com",
"email": "oliver@anadea.com",
"projectHostname": "https://anadea.visualstudio.com",
"tenantId": "df7abg9c-c05a-4fc9-b958-64faered911d",
"createdAt": "2020-09-22T07:13:53.307Z",
"updatedAt": "2020-09-22T07:13:53.307Z",
"_id": "5f69a4314d596392f570e8d6"
}

Error

Code : 400 Bad Request

Message

{

"code": "User mapping already exist.",

"message": "User mapping already exist."

}