POST api/users/validation
These are the NEW semantics for this endpoint. Used to pre-validate a partial user record (Email, Firstname, Lastname) POST a user record in the body of a request to /api/users/validation. If the user is valid and a record already exists in CRM returns 200 OK and the full user record in the body. If the user is associated with an organisaiton in CRM, the organisaitonId and organisaiton memebrship number are returned. If the user is valid but does not yet exist in CRM, record(s) are created in CRM and the endpoint returns 201 Created, with the user record in the body. If there is an organisation membership number attached, then that is checked against CRM. If not found, then a 400 is returned. If the organisaiton memebrship number is recognised but the user is not currently associated with that organisaiton in CRM, then we move the user to that organisation. For syntax errors returns 400 Bad Request and a message that explains the error in the response body CRM errors will return 502 Bad gateway, any other errors 500 Internal Server Error.
Request Information
URI Parameters
None.
Body Parameters
UserName | Description | Type | Additional information |
---|---|---|---|
Id | globally unique identifier |
None. |
|
IdSource | integer |
None. |
|
Login | string |
None. |
|
FirstName | string |
None. |
|
LastName | string |
None. |
|
string |
None. |
||
Telephone | string |
None. |
|
OrgMemberNumber | string |
None. |
|
OrgId | globally unique identifier |
None. |
|
StatusValue | integer |
None. |
|
StatusLabel | string |
None. |
|
JobTitle | string |
None. |
|
JobRole | globally unique identifier |
None. |
|
InvitationCode | globally unique identifier |
None. |
|
XrmContactId | globally unique identifier |
None. |
Request Formats
application/json, text/json
{ "Id": "d0a6b7f5-a7b4-4be4-88b4-eb17efd7e6ac", "IdSource": 2, "Login": "sample string 3", "FirstName": "sample string 4", "LastName": "sample string 5", "Email": "sample string 6", "Telephone": "sample string 7", "OrgMemberNumber": "sample string 8", "OrgId": "4c4f98b1-a2d9-4bed-9003-6e78a35eb78d", "StatusValue": 9, "StatusLabel": "sample string 10", "JobTitle": "sample string 11", "JobRole": "24ebbe5d-75ff-45b2-ae28-1860829c20a5", "InvitationCode": "53cc0bb1-9336-47b0-a937-96f49a2359ae", "XrmContactId": "6b13ad2f-1a08-468b-9a6d-66b102c8b173" }
application/xml, text/xml
<User xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SSAT.Webservices.Domain"> <Email>sample string 6</Email> <FirstName>sample string 4</FirstName> <Id>d0a6b7f5-a7b4-4be4-88b4-eb17efd7e6ac</Id> <IdSource>2</IdSource> <InvitationCode>53cc0bb1-9336-47b0-a937-96f49a2359ae</InvitationCode> <JobRole>24ebbe5d-75ff-45b2-ae28-1860829c20a5</JobRole> <JobTitle>sample string 11</JobTitle> <LastName>sample string 5</LastName> <Login>sample string 3</Login> <OrgId>4c4f98b1-a2d9-4bed-9003-6e78a35eb78d</OrgId> <OrgMemberNumber>sample string 8</OrgMemberNumber> <StatusLabel>sample string 10</StatusLabel> <StatusValue>9</StatusValue> <Telephone>sample string 7</Telephone> <XrmContactId>6b13ad2f-1a08-468b-9a6d-66b102c8b173</XrmContactId> </User>
application/x-www-form-urlencoded
Response Information
Resource Description
UserRepresentationName | Description | Type | Additional information |
---|---|---|---|
Id |
Unique identifier - same as in CRM |
globally unique identifier |
None. |
LocalLogin |
Login for this system |
string |
None. |
IdSource |
The source of identity for this user. Defined values are: 0 = reserved for test suites; 1 = SSAT website |
integer |
None. |
FirstName |
First name |
string |
None. |
LastName |
last name |
string |
None. |
Email address |
string |
None. |
|
Telephone |
Main telephone number |
string |
None. |
OrgMemberNumber |
Organisation membership number |
string |
None. |
OrgId |
Organisation ID |
globally unique identifier |
None. |
StatusValue |
User status |
integer |
None. |
StatusLabel |
User status label |
string |
None. |
JobTitle |
Free text job title |
string |
None. |
JobRole |
Reference to job role from pre-set list |
globally unique identifier |
None. |
InvitationCode |
Most recent invitation code generated by CRM |
globally unique identifier |
None. |
XrmContactId |
Unique XRM Id for the associated contact (NB N:1 User:Contact) |
globally unique identifier |
None. |
Links | Collection of Link |
None. |
Response Formats
application/json
{ "Id": "e4a62e26-14c6-4048-8dc0-740f092595ea", "LocalLogin": "sample string 2", "IdSource": 3, "FirstName": "sample string 4", "LastName": "sample string 5", "Email": "sample string 6", "Telephone": "sample string 7", "OrgMemberNumber": "sample string 8", "OrgId": "f78d55e7-60b0-4503-a5df-92c38aba33b3", "StatusValue": 9, "StatusLabel": "sample string 10", "JobTitle": "sample string 11", "JobRole": "0ffb35b2-9eb3-4339-9ef0-d94618589de9", "InvitationCode": "d9f35af0-5dda-4e28-bbd2-5bfc11fd46a7", "XrmContactId": "18af9350-c786-4fe1-8199-6517d84b6ff9", "_links": [ { "Rel": "self", "Href": "~/users/e4a62e26-14c6-4048-8dc0-740f092595ea", "Title": null, "IsTemplated": false }, { "Rel": "sample string 1", "Href": "sample string 2", "Title": "sample string 3", "IsTemplated": false }, { "Rel": "sample string 1", "Href": "sample string 2", "Title": "sample string 3", "IsTemplated": false }, { "Rel": "roles", "Href": "~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles", "Title": null, "IsTemplated": false }, { "Rel": "subjects", "Href": "~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects", "Title": null, "IsTemplated": false } ], "_embedded": null }
text/json
{ "Id": "e4a62e26-14c6-4048-8dc0-740f092595ea", "LocalLogin": "sample string 2", "IdSource": 3, "FirstName": "sample string 4", "LastName": "sample string 5", "Email": "sample string 6", "Telephone": "sample string 7", "OrgMemberNumber": "sample string 8", "OrgId": "f78d55e7-60b0-4503-a5df-92c38aba33b3", "StatusValue": 9, "StatusLabel": "sample string 10", "JobTitle": "sample string 11", "JobRole": "0ffb35b2-9eb3-4339-9ef0-d94618589de9", "InvitationCode": "d9f35af0-5dda-4e28-bbd2-5bfc11fd46a7", "XrmContactId": "18af9350-c786-4fe1-8199-6517d84b6ff9", "_links": [ { "Rel": "self", "Href": "~/users/e4a62e26-14c6-4048-8dc0-740f092595ea", "Title": null, "IsTemplated": false }, { "Rel": "sample string 1", "Href": "sample string 2", "Title": "sample string 3", "IsTemplated": false }, { "Rel": "sample string 1", "Href": "sample string 2", "Title": "sample string 3", "IsTemplated": false }, { "Rel": "roles", "Href": "~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles", "Title": null, "IsTemplated": false }, { "Rel": "subjects", "Href": "~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects", "Title": null, "IsTemplated": false }, { "Rel": "roles", "Href": "~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles", "Title": null, "IsTemplated": false }, { "Rel": "subjects", "Href": "~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects", "Title": null, "IsTemplated": false } ], "_embedded": null }
application/xml
<UserRepresentation xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SSAT.WebServices.WebApp.Representations.Version1"> <Href xmlns="http://schemas.datacontract.org/2004/07/WebApi.Hal">~/users/e4a62e26-14c6-4048-8dc0-740f092595ea</Href> <LinkName xmlns="http://schemas.datacontract.org/2004/07/WebApi.Hal">sample string 15</LinkName> <Links xmlns="http://schemas.datacontract.org/2004/07/WebApi.Hal"> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea</Href> <Rel>self</Rel> <Title i:nil="true" /> </Link> <Link> <Href>sample string 2</Href> <Rel>sample string 1</Rel> <Title>sample string 3</Title> </Link> <Link> <Href>sample string 2</Href> <Rel>sample string 1</Rel> <Title>sample string 3</Title> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles</Href> <Rel>roles</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects</Href> <Rel>subjects</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles</Href> <Rel>roles</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects</Href> <Rel>subjects</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles</Href> <Rel>roles</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects</Href> <Rel>subjects</Rel> <Title i:nil="true" /> </Link> </Links> <Rel xmlns="http://schemas.datacontract.org/2004/07/WebApi.Hal">sample string 13</Rel> <Email>sample string 6</Email> <FirstName>sample string 4</FirstName> <Id>e4a62e26-14c6-4048-8dc0-740f092595ea</Id> <IdSource>3</IdSource> <InvitationCode>d9f35af0-5dda-4e28-bbd2-5bfc11fd46a7</InvitationCode> <JobRole>0ffb35b2-9eb3-4339-9ef0-d94618589de9</JobRole> <JobTitle>sample string 11</JobTitle> <LastName>sample string 5</LastName> <LocalLogin>sample string 2</LocalLogin> <OrgId>f78d55e7-60b0-4503-a5df-92c38aba33b3</OrgId> <OrgMemberNumber>sample string 8</OrgMemberNumber> <StatusLabel>sample string 10</StatusLabel> <StatusValue>9</StatusValue> <Telephone>sample string 7</Telephone> <XrmContactId>18af9350-c786-4fe1-8199-6517d84b6ff9</XrmContactId> </UserRepresentation>
text/xml
<UserRepresentation xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SSAT.WebServices.WebApp.Representations.Version1"> <Href xmlns="http://schemas.datacontract.org/2004/07/WebApi.Hal">~/users/e4a62e26-14c6-4048-8dc0-740f092595ea</Href> <LinkName xmlns="http://schemas.datacontract.org/2004/07/WebApi.Hal">sample string 15</LinkName> <Links xmlns="http://schemas.datacontract.org/2004/07/WebApi.Hal"> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea</Href> <Rel>self</Rel> <Title i:nil="true" /> </Link> <Link> <Href>sample string 2</Href> <Rel>sample string 1</Rel> <Title>sample string 3</Title> </Link> <Link> <Href>sample string 2</Href> <Rel>sample string 1</Rel> <Title>sample string 3</Title> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles</Href> <Rel>roles</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects</Href> <Rel>subjects</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles</Href> <Rel>roles</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects</Href> <Rel>subjects</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles</Href> <Rel>roles</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects</Href> <Rel>subjects</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles</Href> <Rel>roles</Rel> <Title i:nil="true" /> </Link> <Link> <Href>~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects</Href> <Rel>subjects</Rel> <Title i:nil="true" /> </Link> </Links> <Rel xmlns="http://schemas.datacontract.org/2004/07/WebApi.Hal">sample string 13</Rel> <Email>sample string 6</Email> <FirstName>sample string 4</FirstName> <Id>e4a62e26-14c6-4048-8dc0-740f092595ea</Id> <IdSource>3</IdSource> <InvitationCode>d9f35af0-5dda-4e28-bbd2-5bfc11fd46a7</InvitationCode> <JobRole>0ffb35b2-9eb3-4339-9ef0-d94618589de9</JobRole> <JobTitle>sample string 11</JobTitle> <LastName>sample string 5</LastName> <LocalLogin>sample string 2</LocalLogin> <OrgId>f78d55e7-60b0-4503-a5df-92c38aba33b3</OrgId> <OrgMemberNumber>sample string 8</OrgMemberNumber> <StatusLabel>sample string 10</StatusLabel> <StatusValue>9</StatusValue> <Telephone>sample string 7</Telephone> <XrmContactId>18af9350-c786-4fe1-8199-6517d84b6ff9</XrmContactId> </UserRepresentation>
application/hal+json
{ "Id": "e4a62e26-14c6-4048-8dc0-740f092595ea", "LocalLogin": "sample string 2", "IdSource": 3, "FirstName": "sample string 4", "LastName": "sample string 5", "Email": "sample string 6", "Telephone": "sample string 7", "OrgMemberNumber": "sample string 8", "OrgId": "f78d55e7-60b0-4503-a5df-92c38aba33b3", "StatusValue": 9, "StatusLabel": "sample string 10", "JobTitle": "sample string 11", "JobRole": "0ffb35b2-9eb3-4339-9ef0-d94618589de9", "InvitationCode": "d9f35af0-5dda-4e28-bbd2-5bfc11fd46a7", "XrmContactId": "18af9350-c786-4fe1-8199-6517d84b6ff9", "_links": { "self": { "href": "/users/e4a62e26-14c6-4048-8dc0-740f092595ea" }, "sample string 1": { "href": "sample string 2", "title": "sample string 3" }, "roles": { "href": "/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles" }, "subjects": { "href": "/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects" } } }
application/hal+xml
<resource rel="sample string 13" href="~/users/e4a62e26-14c6-4048-8dc0-740f092595ea" name="sample string 15"> <link rel="sample string 1" href="sample string 2" /> <link rel="roles" href="~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/roles" /> <link rel="subjects" href="~/users/e4a62e26-14c6-4048-8dc0-740f092595ea/subjects" /> <Id>e4a62e26-14c6-4048-8dc0-740f092595ea</Id> <LocalLogin>sample string 2</LocalLogin> <IdSource>3</IdSource> <FirstName>sample string 4</FirstName> <LastName>sample string 5</LastName> <Email>sample string 6</Email> <Telephone>sample string 7</Telephone> <OrgMemberNumber>sample string 8</OrgMemberNumber> <OrgId>f78d55e7-60b0-4503-a5df-92c38aba33b3</OrgId> <StatusValue>9</StatusValue> <StatusLabel>sample string 10</StatusLabel> <JobTitle>sample string 11</JobTitle> <JobRole>0ffb35b2-9eb3-4339-9ef0-d94618589de9</JobRole> <InvitationCode>d9f35af0-5dda-4e28-bbd2-5bfc11fd46a7</InvitationCode> <XrmContactId>18af9350-c786-4fe1-8199-6517d84b6ff9</XrmContactId> </resource>