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

User
NameDescriptionTypeAdditional information
Id

globally unique identifier

None.

IdSource

integer

None.

Login

string

None.

FirstName

string

None.

LastName

string

None.

Email

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

Sample:
{
  "Id": "b087cfd1-2cb9-4a1d-9e94-45a753ec66d3",
  "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": "992875cf-2201-4421-9a0f-851c8d04e157",
  "StatusValue": 9,
  "StatusLabel": "sample string 10",
  "JobTitle": "sample string 11",
  "JobRole": "c48f91f3-649c-4f35-bc79-7e7f61af4db9",
  "InvitationCode": "3f6b79a2-a791-4f25-afd2-b2f0e6d842ba",
  "XrmContactId": "643b988b-8d05-45a6-a0aa-16d02386d144"
}

application/xml, text/xml

Sample:
<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>b087cfd1-2cb9-4a1d-9e94-45a753ec66d3</Id>
  <IdSource>2</IdSource>
  <InvitationCode>3f6b79a2-a791-4f25-afd2-b2f0e6d842ba</InvitationCode>
  <JobRole>c48f91f3-649c-4f35-bc79-7e7f61af4db9</JobRole>
  <JobTitle>sample string 11</JobTitle>
  <LastName>sample string 5</LastName>
  <Login>sample string 3</Login>
  <OrgId>992875cf-2201-4421-9a0f-851c8d04e157</OrgId>
  <OrgMemberNumber>sample string 8</OrgMemberNumber>
  <StatusLabel>sample string 10</StatusLabel>
  <StatusValue>9</StatusValue>
  <Telephone>sample string 7</Telephone>
  <XrmContactId>643b988b-8d05-45a6-a0aa-16d02386d144</XrmContactId>
</User>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'User'.

Response Information

Resource Description

UserRepresentation
NameDescriptionTypeAdditional 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

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

Sample:
{
  "Id": "98d525fe-fe04-4c57-9ea0-1799dcdfd71f",
  "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": "e17b7695-d8d6-4740-b067-7039f6da4c59",
  "StatusValue": 9,
  "StatusLabel": "sample string 10",
  "JobTitle": "sample string 11",
  "JobRole": "df0f6628-923d-4503-bbd8-69d085dec205",
  "InvitationCode": "180751f4-e75a-4abd-834e-97e66b06b7c5",
  "XrmContactId": "7bb2fef8-ae3a-4fa0-84db-bd9c9def2616",
  "_links": [
    {
      "Rel": "self",
      "Href": "~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f",
      "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/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles",
      "Title": null,
      "IsTemplated": false
    },
    {
      "Rel": "subjects",
      "Href": "~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects",
      "Title": null,
      "IsTemplated": false
    }
  ],
  "_embedded": null
}

text/json

Sample:
{
  "Id": "98d525fe-fe04-4c57-9ea0-1799dcdfd71f",
  "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": "e17b7695-d8d6-4740-b067-7039f6da4c59",
  "StatusValue": 9,
  "StatusLabel": "sample string 10",
  "JobTitle": "sample string 11",
  "JobRole": "df0f6628-923d-4503-bbd8-69d085dec205",
  "InvitationCode": "180751f4-e75a-4abd-834e-97e66b06b7c5",
  "XrmContactId": "7bb2fef8-ae3a-4fa0-84db-bd9c9def2616",
  "_links": [
    {
      "Rel": "self",
      "Href": "~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f",
      "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/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles",
      "Title": null,
      "IsTemplated": false
    },
    {
      "Rel": "subjects",
      "Href": "~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects",
      "Title": null,
      "IsTemplated": false
    },
    {
      "Rel": "roles",
      "Href": "~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles",
      "Title": null,
      "IsTemplated": false
    },
    {
      "Rel": "subjects",
      "Href": "~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects",
      "Title": null,
      "IsTemplated": false
    }
  ],
  "_embedded": null
}

application/xml

Sample:
<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/98d525fe-fe04-4c57-9ea0-1799dcdfd71f</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/98d525fe-fe04-4c57-9ea0-1799dcdfd71f</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/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles</Href>
      <Rel>roles</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects</Href>
      <Rel>subjects</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles</Href>
      <Rel>roles</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects</Href>
      <Rel>subjects</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles</Href>
      <Rel>roles</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/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>98d525fe-fe04-4c57-9ea0-1799dcdfd71f</Id>
  <IdSource>3</IdSource>
  <InvitationCode>180751f4-e75a-4abd-834e-97e66b06b7c5</InvitationCode>
  <JobRole>df0f6628-923d-4503-bbd8-69d085dec205</JobRole>
  <JobTitle>sample string 11</JobTitle>
  <LastName>sample string 5</LastName>
  <LocalLogin>sample string 2</LocalLogin>
  <OrgId>e17b7695-d8d6-4740-b067-7039f6da4c59</OrgId>
  <OrgMemberNumber>sample string 8</OrgMemberNumber>
  <StatusLabel>sample string 10</StatusLabel>
  <StatusValue>9</StatusValue>
  <Telephone>sample string 7</Telephone>
  <XrmContactId>7bb2fef8-ae3a-4fa0-84db-bd9c9def2616</XrmContactId>
</UserRepresentation>

text/xml

Sample:
<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/98d525fe-fe04-4c57-9ea0-1799dcdfd71f</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/98d525fe-fe04-4c57-9ea0-1799dcdfd71f</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/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles</Href>
      <Rel>roles</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects</Href>
      <Rel>subjects</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles</Href>
      <Rel>roles</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects</Href>
      <Rel>subjects</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles</Href>
      <Rel>roles</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects</Href>
      <Rel>subjects</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles</Href>
      <Rel>roles</Rel>
      <Title i:nil="true" />
    </Link>
    <Link>
      <Href>~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/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>98d525fe-fe04-4c57-9ea0-1799dcdfd71f</Id>
  <IdSource>3</IdSource>
  <InvitationCode>180751f4-e75a-4abd-834e-97e66b06b7c5</InvitationCode>
  <JobRole>df0f6628-923d-4503-bbd8-69d085dec205</JobRole>
  <JobTitle>sample string 11</JobTitle>
  <LastName>sample string 5</LastName>
  <LocalLogin>sample string 2</LocalLogin>
  <OrgId>e17b7695-d8d6-4740-b067-7039f6da4c59</OrgId>
  <OrgMemberNumber>sample string 8</OrgMemberNumber>
  <StatusLabel>sample string 10</StatusLabel>
  <StatusValue>9</StatusValue>
  <Telephone>sample string 7</Telephone>
  <XrmContactId>7bb2fef8-ae3a-4fa0-84db-bd9c9def2616</XrmContactId>
</UserRepresentation>

application/hal+json

Sample:
{
  "Id": "98d525fe-fe04-4c57-9ea0-1799dcdfd71f",
  "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": "e17b7695-d8d6-4740-b067-7039f6da4c59",
  "StatusValue": 9,
  "StatusLabel": "sample string 10",
  "JobTitle": "sample string 11",
  "JobRole": "df0f6628-923d-4503-bbd8-69d085dec205",
  "InvitationCode": "180751f4-e75a-4abd-834e-97e66b06b7c5",
  "XrmContactId": "7bb2fef8-ae3a-4fa0-84db-bd9c9def2616",
  "_links": {
    "self": {
      "href": "/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f"
    },
    "sample string 1": {
      "href": "sample string 2",
      "title": "sample string 3"
    },
    "roles": {
      "href": "/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles"
    },
    "subjects": {
      "href": "/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects"
    }
  }
}

application/hal+xml

Sample:
<resource rel="sample string 13" href="~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f" name="sample string 15">
  <link rel="sample string 1" href="sample string 2" />
  <link rel="roles" href="~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/roles" />
  <link rel="subjects" href="~/users/98d525fe-fe04-4c57-9ea0-1799dcdfd71f/subjects" />
  <Id>98d525fe-fe04-4c57-9ea0-1799dcdfd71f</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>e17b7695-d8d6-4740-b067-7039f6da4c59</OrgId>
  <StatusValue>9</StatusValue>
  <StatusLabel>sample string 10</StatusLabel>
  <JobTitle>sample string 11</JobTitle>
  <JobRole>df0f6628-923d-4503-bbd8-69d085dec205</JobRole>
  <InvitationCode>180751f4-e75a-4abd-834e-97e66b06b7c5</InvitationCode>
  <XrmContactId>7bb2fef8-ae3a-4fa0-84db-bd9c9def2616</XrmContactId>
</resource>