API Documentation

In-depth reference documentation for iQmetrix API's.

NAV

OVERVIEW

The User Manager API allows you to manage User accounts for your Company.

To learn more about User Manager, see User Manager.

ENDPOINTS

Sandbox: https://usermanagerdemo.iqmetrix.net/v1
Production: https://usermanager.iqmetrix.net/v1

RESOURCES

User

A User represents an account that can be used to perform actions on your data within iQmetrix APIs.

{
    "Id": 2576,
    "FirstName": "John",
    "LastName": "Bates",
    "UserName": "johnb@kentel.com",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "ClientUserId": "132",
    "Email": "johnb@kentel.com",
    "IsActive": true,
    "JobTitle": "Sales Clerk",
    "ParentEntityId": 1,
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ],
    "Picture": {},
    "Version": 1
}
Name Description  
Id (Integer) Identifier  
FirstName (String) First name  
LastName (String) Last name  
UserName (String) Name to be used to identify this User, must be unique  
Address (Address) Address  
ClientUserId (String) Identifier for the User in an external system  
Email (String) Email for the User. Must be unique. A notification will be sent to this address when a User is created.  
IsActive (Boolean) Flag to indicate if the Users login is enabled, false if it is disabled  
JobTitle (String) Job title  
ParentEntityId (Integer) Identifier for the Company to which this User belongs  
PhoneNumbers (Array[PhoneNumber]) Phone numbers  
Picture (Object) A reference to an Asset that is a photo of the User  
Version (Integer) Latest revision number  
Attributes (Object) Reserved for future use  
CorrelationId (String) Reserved for internal use  
Profiles (Array) This is a legacy property that should not be used  

Address

{
    "AddressLine1": "1432 Merry View Road",
    "AddressLine2": "",
    "City": "Big Windy",
    "StateCode": "ON",
    "CountryCode": "CA",
    "Zip": "A1A2B2"
}
Name Description
AddressLine1 (String)  
AddressLine2 (String)  
City (String)  
StateCode (String) Code for the State in which this address resides. Based off the ISO 3166-2 standard
CountryCode (String) Country in which this address resides. Uses the ISO 3166-1 alpha-2 standard. For a list of accptable Countries, see Getting All Countries
Zip (String) Zip or Postal Code

PhoneNumber

{
    "Number": "6135550127",
    "Extension": "5532",
    "Type": "Work"
}
Name Description
Number (String) Must be at least 7 characters
Extension (String) Extension
Type (String) Type of phone number

LockReason

A LockReason allows you to provide a reason when Locking a User. Examples of reasons might include:

{
    "Id": 14,
    "Name": "PaperworkNotDone",
    "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
}
Name Description
Id (Integer) Identifier
Name (String) Lock reason name
Description (String) Text that will appear to User when locked out

REQUESTS

Importing an Existing User

This request allows existing Users to be imported from another system.

Request

POST /Users/importExisting

Example Request

POST /Users/importExisting
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "UserName": "johnb@kentel",
    "Password": "samplepassword",
    "Email": "johnb@kentel.com",
    "FirstName": "John",
    "LastName": "Bates",
    "ParentEntityId": 1,
    "ClientUserId": "132",
    "JobTitle": "Sales Clerk",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ]
}
curl -X POST "https://usermanagerdemo.iqmetrix.net/v1/Users/importExisting" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "UserName": "johnb@kentel",
    "Password": "samplepassword",
    "Email": "johnb@kentel.com",
    "FirstName": "John",
    "LastName": "Bates",
    "ParentEntityId": 1,
    "ClientUserId": "132",
    "JobTitle": "Sales Clerk",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ]
}'
static IRestResponse ImportingAnExistingUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users/importExisting");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"UserName\":\"johnb@kentel\",\"Password\":\"samplepassword\",\"Email\":\"johnb@kentel.com\",\"FirstName\":\"John\",\"LastName\":\"Bates\",\"ParentEntityId\":1,\"ClientUserId\":\"132\",\"JobTitle\":\"Sales Clerk\",\"Address\":{\"AddressLine1\":\"1432 Merry View Road\",\"AddressLine2\":\"\",\"City\":\"Big Windy\",\"StateCode\":\"ON\",\"CountryCode\":\"CA\",\"Zip\":\"A1A2B2\"},\"PhoneNumbers\":[{\"Number\":\"6135550127\",\"Extension\":\"5532\",\"Type\":\"Work\"}]}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse ImportingAnExistingUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://usermanagerdemo.iqmetrix.net/v1/Users/importExisting");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"UserName\":\"johnb@kentel\",\"Password\":\"samplepassword\",\"Email\":\"johnb@kentel.com\",\"FirstName\":\"John\",\"LastName\":\"Bates\",\"ParentEntityId\":1,\"ClientUserId\":\"132\",\"JobTitle\":\"Sales Clerk\",\"Address\":{\"AddressLine1\":\"1432 Merry View Road\",\"AddressLine2\":\"\",\"City\":\"Big Windy\",\"StateCode\":\"ON\",\"CountryCode\":\"CA\",\"Zip\":\"A1A2B2\"},\"PhoneNumbers\":[{\"Number\":\"6135550127\",\"Extension\":\"5532\",\"Type\":\"Work\"}]}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"UserName\":\"johnb@kentel\",\"Password\":\"samplepassword\",\"Email\":\"johnb@kentel.com\",\"FirstName\":\"John\",\"LastName\":\"Bates\",\"ParentEntityId\":1,\"ClientUserId\":\"132\",\"JobTitle\":\"Sales Clerk\",\"Address\":{\"AddressLine1\":\"1432 Merry View Road\",\"AddressLine2\":\"\",\"City\":\"Big Windy\",\"StateCode\":\"ON\",\"CountryCode\":\"CA\",\"Zip\":\"A1A2B2\"},\"PhoneNumbers\":[{\"Number\":\"6135550127\",\"Extension\":\"5532\",\"Type\":\"Work\"}]}";

response = RestClient.post 'https://usermanagerdemo.iqmetrix.net/v1/Users/importExisting', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

Request Parameters

Response Parameters

Example Response

HTTP 201 Content-Type: application/json
{
    "Id": 2576,
    "FirstName": "John",
    "LastName": "Bates",
    "UserName": "johnb@kentel.com",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "ClientUserId": "132",
    "Email": "johnb@kentel.com",
    "IsActive": true,
    "JobTitle": "Sales Clerk",
    "ParentEntityId": 1,
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ],
    "Picture": {},
    "Version": 1
}

User

GET a User

Request

GET /Users({UserId})

Example Request

GET /Users(2576)
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingAUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingAUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 2576,
    "FirstName": "John",
    "LastName": "Bates",
    "UserName": "johnb@kentel.com",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "ClientUserId": "132",
    "Email": "johnb@kentel.com",
    "IsActive": true,
    "JobTitle": "Sales Clerk",
    "ParentEntityId": 1,
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ],
    "Picture": {},
    "Version": 1
}

User

PUT a User

Request

PUT /Users({UserId})

Example Request

PUT /Users(2576)
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "Id": 2576,
    "FirstName": "John",
    "LastName": "Bates",
    "UserName": "johnb@kentel.com",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "ClientUserId": "132",
    "Email": "johnb@kentel.com",
    "IsActive": true,
    "JobTitle": "Sales Clerk",
    "ParentEntityId": 1,
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ],
    "Picture": {},
    "Version": 1
}
curl -X PUT "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "Id": 2576,
    "FirstName": "John",
    "LastName": "Bates",
    "UserName": "johnb@kentel.com",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "ClientUserId": "132",
    "Email": "johnb@kentel.com",
    "IsActive": true,
    "JobTitle": "Sales Clerk",
    "ParentEntityId": 1,
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ],
    "Picture": {},
    "Version": 1
}'
static IRestResponse UpdatingAUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)");
    var request = new RestRequest(Method.PUT);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"Id\":2576,\"FirstName\":\"John\",\"LastName\":\"Bates\",\"UserName\":\"johnb@kentel.com\",\"Address\":{\"AddressLine1\":\"1432 Merry View Road\",\"AddressLine2\":\"\",\"City\":\"Big Windy\",\"StateCode\":\"ON\",\"CountryCode\":\"CA\",\"Zip\":\"A1A2B2\"},\"ClientUserId\":\"132\",\"Email\":\"johnb@kentel.com\",\"IsActive\":true,\"JobTitle\":\"Sales Clerk\",\"ParentEntityId\":1,\"PhoneNumbers\":[{\"Number\":\"6135550127\",\"Extension\":\"5532\",\"Type\":\"Work\"}],\"Picture\":{},\"Version\":1}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse UpdatingAUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPut request = new HttpPut("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"Id\":2576,\"FirstName\":\"John\",\"LastName\":\"Bates\",\"UserName\":\"johnb@kentel.com\",\"Address\":{\"AddressLine1\":\"1432 Merry View Road\",\"AddressLine2\":\"\",\"City\":\"Big Windy\",\"StateCode\":\"ON\",\"CountryCode\":\"CA\",\"Zip\":\"A1A2B2\"},\"ClientUserId\":\"132\",\"Email\":\"johnb@kentel.com\",\"IsActive\":true,\"JobTitle\":\"Sales Clerk\",\"ParentEntityId\":1,\"PhoneNumbers\":[{\"Number\":\"6135550127\",\"Extension\":\"5532\",\"Type\":\"Work\"}],\"Picture\":{},\"Version\":1}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"Id\":2576,\"FirstName\":\"John\",\"LastName\":\"Bates\",\"UserName\":\"johnb@kentel.com\",\"Address\":{\"AddressLine1\":\"1432 Merry View Road\",\"AddressLine2\":\"\",\"City\":\"Big Windy\",\"StateCode\":\"ON\",\"CountryCode\":\"CA\",\"Zip\":\"A1A2B2\"},\"ClientUserId\":\"132\",\"Email\":\"johnb@kentel.com\",\"IsActive\":true,\"JobTitle\":\"Sales Clerk\",\"ParentEntityId\":1,\"PhoneNumbers\":[{\"Number\":\"6135550127\",\"Extension\":\"5532\",\"Type\":\"Work\"}],\"Picture\":{},\"Version\":1}";

response = RestClient.put 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 2576,
    "FirstName": "John",
    "LastName": "Bates",
    "UserName": "johnb@kentel.com",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "ClientUserId": "132",
    "Email": "johnb@kentel.com",
    "IsActive": true,
    "JobTitle": "Sales Clerk",
    "ParentEntityId": 1,
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ],
    "Picture": {},
    "Version": 1
}

User

Disabling a User

Request

DELETE /Users({UserId})

Example Request

DELETE /Users(2576)
Authorization: Bearer (Access Token)

curl -X DELETE "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)" -H "Authorization: Bearer (Access Token)"
static IRestResponse DisablingAUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)");
    var request = new RestRequest(Method.DELETE);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse DisablingAUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpDelete request = new HttpDelete("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.delete 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)', {
     :'Authorization' => 'Bearer (Access Token)',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 2576,
    "FirstName": "John",
    "LastName": "Bates",
    "UserName": "johnb@kentel.com",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "ClientUserId": "132",
    "Email": "johnb@kentel.com",
    "IsActive": false,
    "JobTitle": "Sales Clerk",
    "ParentEntityId": 1,
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ],
    "Picture": {},
    "Version": 2
}

User

GET All Users for a Company

This request will only return Users where IsActive is set to true.

Request

GET /Entities({CompanyId})/Users?$skip={Skip}&$top={Top}

Example Request

GET /Entities(14146)/Users?$skip=1&$top=10
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users?$skip=1&$top=10" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingAllUsersForACompany()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users?$skip=1&$top=10");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingAllUsersForACompany() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users?$skip=1&$top=10");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users?$skip=1&$top=10', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "_links": {
        "prev": "null",
        "self": "/v1/entities(14146)/users?$skip=0&$top=30",
        "next": "null"
    },
    "_metadata": {
        "count": 1,
        "skip": 0,
        "top": 30
    },
    "items": [
        {
            "Id": 2576,
            "FirstName": "John",
            "LastName": "Bates",
            "UserName": "johnb@kentel.com",
            "Address": {
                "AddressLine1": "1432 Merry View Road",
                "AddressLine2": "",
                "City": "Big Windy",
                "StateCode": "ON",
                "CountryCode": "CA",
                "Zip": "A1A2B2"
            },
            "ClientUserId": "132",
            "Email": "johnb@kentel.com",
            "IsActive": true,
            "JobTitle": "Sales Clerk",
            "ParentEntityId": 1,
            "PhoneNumbers": [
                {
                    "Number": "6135550127",
                    "Extension": "5532",
                    "Type": "Work"
                }
            ],
            "Picture": {},
            "Version": 1
        }
    ]
}

Searching for Users

This request will only return Users where IsActive is set to true.

Request

GET /Entities({CompanyId})/Users/Search?terms={Terms}&$skip={Skip}&$top={Top}

Example Request

GET /Entities(14146)/Users/Search?terms=Sam+Smith&$skip=1&$top=10
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users/Search?terms=Sam+Smith&$skip=1&$top=10" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse SearchingForUsers()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users/Search?terms=Sam+Smith&$skip=1&$top=10");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse SearchingForUsers() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users/Search?terms=Sam+Smith&$skip=1&$top=10");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users/Search?terms=Sam+Smith&$skip=1&$top=10', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "_links": {
        "prev": "null",
        "self": "/v1/entities(14146)/users?$skip=0&$top=30",
        "next": "null"
    },
    "_metadata": {
        "count": 1,
        "skip": 0,
        "top": 30
    },
    "items": [
        {
            "Id": 2576,
            "FirstName": "John",
            "LastName": "Bates",
            "UserName": "johnb@kentel.com",
            "Address": {
                "AddressLine1": "1432 Merry View Road",
                "AddressLine2": "",
                "City": "Big Windy",
                "StateCode": "ON",
                "CountryCode": "CA",
                "Zip": "A1A2B2"
            },
            "ClientUserId": "132",
            "Email": "johnb@kentel.com",
            "IsActive": true,
            "JobTitle": "Sales Clerk",
            "ParentEntityId": 1,
            "PhoneNumbers": [
                {
                    "Number": "6135550127",
                    "Extension": "5532",
                    "Type": "Work"
                }
            ],
            "Picture": {},
            "Version": 1
        }
    ]
}

Assigning a User to a Location

Request

PUT /Users({UserId})/Locations({LocationId})

Example Request

PUT /Users(2576)/Locations(2)
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

curl -X PUT "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations(2)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json"
static IRestResponse AssigningAUserToALocation()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations(2)");
    var request = new RestRequest(Method.PUT);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

    

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse AssigningAUserToALocation() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPut request = new HttpPut("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations(2)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.put 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations(2)', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 204 Content-Type: application/json

Unassigning a User from a Location

Request

DELETE /Users({UserId})/Locations({LocationId})

Example Request

DELETE /Users(2576)/Locations(2)
Authorization: Bearer (Access Token)
Accept: application/json

curl -X DELETE "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations(2)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse UnassigningAUserFromALocation()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations(2)");
    var request = new RestRequest(Method.DELETE);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse UnassigningAUserFromALocation() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpDelete request = new HttpDelete("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations(2)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.delete 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations(2)', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 204 Content-Type: application/json

GET Assigned Locations for a User

Request

GET /Users({UserId})/Locations

Example Request

GET /Users(2576)/Locations
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingAssignedLocationsForAUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingAssignedLocationsForAUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Locations', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "UserID": 2576,
    "LocationIDs": [
        14202
    ]
}

GET Users by ClientUserId

Request

GET /Entities({CompanyId})/Users?$filter=ClientUserId eq '{ClientUserId}'&$skip={Skip}&$top={Top}

Example Request

GET /Entities(14146)/Users?$filter=ClientUserId eq '132'&$skip=1&$top=10
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users?$filter=ClientUserId eq '132'&$skip=1&$top=10" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingUsersByClientuserid()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users?$filter=ClientUserId eq '132'&$skip=1&$top=10");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingUsersByClientuserid() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users?$filter=ClientUserId eq '132'&$skip=1&$top=10");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/Users?$filter=ClientUserId eq '132'&$skip=1&$top=10', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
[
    {
        "Id": 2576,
        "FirstName": "John",
        "LastName": "Bates",
        "UserName": "johnb@kentel.com",
        "Address": {
            "AddressLine1": "1432 Merry View Road",
            "AddressLine2": "",
            "City": "Big Windy",
            "StateCode": "ON",
            "CountryCode": "CA",
            "Zip": "A1A2B2"
        },
        "ClientUserId": "132",
        "Email": "johnb@kentel.com",
        "IsActive": true,
        "JobTitle": "Sales Clerk",
        "ParentEntityId": 1,
        "PhoneNumbers": [
            {
                "Number": "6135550127",
                "Extension": "5532",
                "Type": "Work"
            }
        ],
        "Picture": {},
        "Version": 1
    }
]

Array[User]

Locking a User

Request

POST /Users({UserId})/Lock

Example Request

POST /Users(2576)/Lock
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
  "LockReasonId": 14
}

curl -X POST "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Lock" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
  "LockReasonId": 14
}
'
static IRestResponse LockingAUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Lock");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"LockReasonId\":14}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse LockingAUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Lock");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"LockReasonId\":14}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"LockReasonId\":14}

response = RestClient.post 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Lock', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 204 Content-Type: application/json

GET the Lock Status of a User

This request will return true if the User is currently Locked, and false if the User is unlocked.

Request

GET /Users({UserId})/Unlock

Example Request

GET /Users(2576)/Unlock
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Unlock" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingTheLockStatusOfAUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Unlock");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingTheLockStatusOfAUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Unlock");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Unlock', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "CanUnlockUser": true,
    "LockReasonId": 14
}

Unlocking a User

Request

POST /Users({UserId})/Unlock

Example Request

POST /Users(2576)/Unlock
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

curl -X POST "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Unlock" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json"
static IRestResponse UnlockingAUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Unlock");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

    

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse UnlockingAUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Unlock");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.post 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Unlock', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 204 Content-Type: application/json

Enabling a User

Request

POST /Users({UserId})/Enable

Example Request

POST /Users(2576)/Enable
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

curl -X POST "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Enable" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json"
static IRestResponse EnablingAUser()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Enable");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

    

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse EnablingAUser() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Enable");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.post 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/Enable', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 2576,
    "FirstName": "John",
    "LastName": "Bates",
    "UserName": "johnb@kentel.com",
    "Address": {
        "AddressLine1": "1432 Merry View Road",
        "AddressLine2": "",
        "City": "Big Windy",
        "StateCode": "ON",
        "CountryCode": "CA",
        "Zip": "A1A2B2"
    },
    "ClientUserId": "132",
    "Email": "johnb@kentel.com",
    "IsActive": true,
    "JobTitle": "Sales Clerk",
    "ParentEntityId": 1,
    "PhoneNumbers": [
        {
            "Number": "6135550127",
            "Extension": "5532",
            "Type": "Work"
        }
    ],
    "Picture": {},
    "Version": 1
}

User

Setting a Temporary Password

This request will set a User’s password to the provided value and mark it as temporary, forcing the User to change it on first login.

Request

POST /Users({UserId})/TemporaryPassword

Example Request

POST /Users(2576)/TemporaryPassword
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "Password": "newpa55word"
}
curl -X POST "https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/TemporaryPassword" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "Password": "newpa55word"
}'
static IRestResponse SettingATemporaryPassword()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/TemporaryPassword");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"Password\":\"newpa55word\"}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse SettingATemporaryPassword() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/TemporaryPassword");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"Password\":\"newpa55word\"}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"Password\":\"newpa55word\"}";

response = RestClient.post 'https://usermanagerdemo.iqmetrix.net/v1/Users(2576)/TemporaryPassword', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 204 Content-Type: application/json

GET all Lock Reasons

Request

GET /Entities({CompanyId})/lockReasons

Example Request

GET /Entities(14146)/lockReasons
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingAllLockReasons()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingAllLockReasons() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
[
    {
        "Id": 14,
        "Name": "PaperworkNotDone",
        "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
    }
]

Array[LockReason]

POST a Lock Reason

Request

POST /Entities({CompanyId})/lockReasons

Example Request

POST /Entities(14146)/lockReasons
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "Name": "PaperworkNotDone",
    "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
}
curl -X POST "https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "Name": "PaperworkNotDone",
    "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
}'
static IRestResponse CreatingALockReason()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons");
    var request = new RestRequest(Method.POST);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"Name\":\"PaperworkNotDone\",\"Description\":\"Your account has been locked because the paperwork hasn't been done. Please contact your supervisor.\"}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse CreatingALockReason() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPost request = new HttpPost("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"Name\":\"PaperworkNotDone\",\"Description\":\"Your account has been locked because the paperwork hasn't been done. Please contact your supervisor.\"}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"Name\":\"PaperworkNotDone\",\"Description\":\"Your account has been locked because the paperwork hasn't been done. Please contact your supervisor.\"}";

response = RestClient.post 'https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 201 Content-Type: application/json
{
    "Id": 14,
    "Name": "PaperworkNotDone",
    "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
}

LockReason

GET a Lock Reason

Request

GET /Entities({CompanyId})/lockReasons({LockReasonId})

Example Request

GET /Entities(14146)/lockReasons(1)
Authorization: Bearer (Access Token)
Accept: application/json

curl -X GET "https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json"
static IRestResponse GettingALockReason()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingALockReason() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 14,
    "Name": "PaperworkNotDone",
    "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
}

LockReason

PUT a Lock Reason

Request

PUT /Entities({CompanyId})/lockReasons({LockReasonId})

Example Request

PUT /Entities(14146)/lockReasons(1)
Authorization: Bearer (Access Token)
Accept: application/json
Content-Type: application/json

{
    "Id": 14,
    "Name": "PaperworkNotDone",
    "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
}
curl -X PUT "https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)" -H "Authorization: Bearer (Access Token)" -H "Accept: application/json" -H "Content-Type: application/json" -d '{
    "Id": 14,
    "Name": "PaperworkNotDone",
    "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
}'
static IRestResponse UpdatingALockReason()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)");
    var request = new RestRequest(Method.PUT);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/json"); 
    request.AddHeader("Content-Type", "application/json"); 

     request.AddParameter("application/json", "{\"Id\":14,\"Name\":\"PaperworkNotDone\",\"Description\":\"Your account has been locked because the paperwork hasn't been done. Please contact your supervisor.\"}", ParameterType.RequestBody);

    return client.Execute(request);
}
import org.apache.http.entity.StringEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse UpdatingALockReason() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpPut request = new HttpPut("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/json"); 
    request.addHeader("Content-Type", "application/json"); 
    StringEntity body = new StringEntity("{\"Id\":14,\"Name\":\"PaperworkNotDone\",\"Description\":\"Your account has been locked because the paperwork hasn't been done. Please contact your supervisor.\"}");
    request.setEntity(body);
    
    return httpClient.execute(request);
}
require 'rest-client'

body = "{\"Id\":14,\"Name\":\"PaperworkNotDone\",\"Description\":\"Your account has been locked because the paperwork hasn't been done. Please contact your supervisor.\"}";

response = RestClient.put 'https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)', body, {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/json',
     :'Content-Type' => 'application/json',
    } 

puts response

URI Parameters

Request Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json
{
    "Id": 14,
    "Name": "PaperworkNotDone",
    "Description": "Your account has been locked because the paperwork hasn't been done. Please contact your supervisor."
}

LockReason

DELETE a Lock Reason

Request

DELETE /Entities({CompanyId})/lockReasons({LockReasonId})

Example Request

DELETE /Entities(14146)/lockReasons(1)
Authorization: Bearer (Access Token)

curl -X DELETE "https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)" -H "Authorization: Bearer (Access Token)"
static IRestResponse DeletingALockReason()
{
    var client = new RestClient("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)");
    var request = new RestRequest(Method.DELETE);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse DeletingALockReason() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpDelete request = new HttpDelete("https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.delete 'https://usermanagerdemo.iqmetrix.net/v1/Entities(14146)/lockReasons(1)', {
     :'Authorization' => 'Bearer (Access Token)',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/json

ERRORS

HTTP Status Code Description How to Resolve
HTTP 400 The temporary password must be at least 6 characters long Ensure the provided password is at least 6 characters long and not an empty string
HTTP 400 Bad Request Ensure all of the required fields are provided and formatted accurately, for more details see error message
HTTP 400 No search terms provided Ensure search terms are provided in URI
HTTP 400 Query string parameter '$top'
should be within 1 to 100 range but was {x}
Ensure $skip is in the range [0-100]
HTTP 400 Query string parameter '$skip'
should be non-negative but was -1
Ensure $top is non-negative
HTTP 404 User not found Ensure UserId is valid
HTTP 404 Entity not found Ensure LocationId is valid
HTTP 409 Username and email already exist Ensure the email chosen does not already belong to a User.
If the email address belongs to a disabled User, change the email for the disabled User before creating a new User with the original email
HTTP 409 User version mismatch Ensure the Version value provided in the request data matches the Version for the User in the database

PAGINATION

The User Manager API supports pagination of collections of resources for some requests.

Query Parameters

Pagination is done through the use of $skip and $top query string parameters.

$skip denotes the number of items to skip from the entire set of results. This value defaults to 0 if no $skip value is specified. If a value less than 0 is specified, the URI is considered malformed.

$top denotes the maximum number of items to include in the response. This value defaults to 30 if no $top value is specified. Acceptable values are in the range [0-100].

Pagination-enabled requests include links for ‘self’, ‘prev’ and ‘next’ in the response data.

These links are relative, they do not include the base endpoint. It is the responsibility of the client to prepend the appropriate endpoint.

Example
{
    "_links": {
        "prev": null,
        "self": "/v1/Entities(14146)/Users?$skip=0&$top=5",
        "next": "/v1/Entities(14146)/Users?$skip=5&$top=5"
    },
    "_metadata": {
        "count": 15,
        "skip": 0,
        "top": 5
    }
}

In the example above, the _links section is included in the data returned from an API call to Getting All Users for a Company, where $skip=0 and $top=5.

The self.href value is the relative version of the API call that returned these results.

The next.href refers to a resource containing a page with the next 5 items.

The prev.href refers to a resource containing a page with the previous 5 items.

Was this page helpful?