Skip to content

Integrating with SCIM

Yiannis edited this page Mar 14, 2016 · 21 revisions

To provision users into Huddle, there's a number of APIs that support the SCIM specification.

Authentication

To authenticate to the SCIM APIs, use the client credentials flow to obtain an access token

Operations

Users

Create a new user

To create a new user, you can issue a POST request

JSON example

Request
POST /people/companies/123/users HTTP/1.1
Content-Type: application/scim+json
Accept: application/scim+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
Host: api.huddle.net
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "userName":"[email protected]",
  "name":{
    "familyName": "Jensen",
    "givenName": "Barbara"
  },
  "phoneNumbers":[
    {
      "value":"555-555-8377"
    }
  ],
  "title":"Tour Guide",
  "preferredLanguage":"en-US",
  "timezone":"America/Los_Angeles"
}
Response

If successful the method returns a 201 Created response with the created resource. The response includes id and meta data as well as a location header

HTTP/1.1 201 Created
Content-Type: application/scim+json
Location: https://api.huddle.net/people/companies/123/users/78579b5f-39c2-4932-b72a-2485ae233645
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "id": "78579b5f-39c2-4932-b72a-2485ae233645",
  "userName":"[email protected]",
  "name":{
    "familyName": "Jensen",
    "givenName": "Barbara"
  },
  "phoneNumbers":[
    {
      "value":"555-555-8377"
    }
  ],
  "title":"Tour Guide",
  "preferredLanguage":"en-US",
  "timezone":"America/Los_Angeles",
  "meta":{
    "location":"https://api.huddle.net/people/companies/123/users/78579b5f-39c2-4932-b72a-2485ae233645"
  },
}

XML example

Request
POST /people/companies/123/users HTTP/1.1
Content-Type: application/xml
Accept: application/xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
Host: api.huddle.net

<?xml version="1.0" encoding="utf-8"?>
<scimUser xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <schemas>
    <schema>urn:ietf:params:scim:schemas:core:2.0:User</schema>
  </schemas>
  <userName>[email protected]</userName>
  <name>
    <givenName>Barbara</givenName>
    <familyName>Jensen</familyName>
  </name>
  <phoneNumbers>
    <phoneNumber>
      <value>555-555-5555</value>
    </phoneNumber>
  </phoneNumbers>
  <title>Tour Guide</title>
  <preferredLanguage>en-US</preferredLanguage>
  <timezone>America/Los_Angeles</timezone>
</scimUser>
Response
HTTP/1.1 201 Created
Content-Type: application/xml
Location: https://api.huddle.net/people/companies/123/users/78579b5f-39c2-4932-b72a-2485ae233645
<?xml version="1.0" encoding="utf-8"?>
<scimUser xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <schemas>
    <schema>urn:ietf:params:scim:schemas:core:2.0:User</schema>
  </schemas>
  <id>78579b5f-39c2-4932-b72a-2485ae233645</id>
  <userName>[email protected]</userName>
  <name>
    <givenName>Barbara</givenName>
    <familyName>Jensen</familyName>
  </name>
  <phoneNumbers>
    <phoneNumber>
      <value>555-555-5555</value>
    </phoneNumber>
  </phoneNumbers>
  <title>Tour Guide</title>
  <preferredLanguage>en-US</preferredLanguage>
  <timezone>America/Los_Angeles</timezone>
  <meta>
    <location>https://api.huddle.net/people/companies/123/users/78579b5f-39c2-4932-b72a-2485ae233645</Location>
  </meta>
</scimUser>
Other Responses
Case Response
Actor does not have provisioning permissions 403 Forbidden
Actor is not in company 403 Forbidden
Email domain of provisioned user is not authorized for company 403 Forbidden
Request is invalid 400 Bad Request
Provisioned user already exists 409 Conflict
Classic
Clone this wiki locally