Integrations

Sync custom integration

<div>Use the following code snippet to validate an uploaded data file and sync a custom integration</div> <code class="hljs">curl -X PUT -d '{"idFile":"{FILE_ID}", "idAppAccount": "{APP_ACCOUNT_ID}"}' -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" "https://api.toriihq.com/v1.0/services/sync/custom"</code> <ul> <li>The uploaded file must be a JSON file.</li> <li>Before uploading a file using <a href="#operation--files-url-get">File upload API</a>, follow the file schema.</li> <li>File type is "customIntegrationData".</li> <li>Only one sync can run at a time, a 409 error code will be returned if there's an attempt to run more than one sync at a time.</li> </ul> <details> <summary>File schema</summary> Default values are marked in <span style="color:red;">red</span> <ol> <li>users - Array [required] - Must have at least 1 valid user</li> <div>User object:</div> <ul> <li>id - String [optional] - The unique identifier of a user in the application</li> <li>email - String [required]</li> <li>firstName - String [optional]</li> <li>lastName - String [optional]</li> <li>status - Enum (<span style="color:red;">active</span>/deleted ) [optional] - The status of the user in Torii. Only active users are displayed as users of the application</li> <li>externalStatus - String [optional] - The status of the user as it appears on the application’s site</li> <li>roles - String[] [optional]</li> <li>lastUsedDate - Date [optional] - ISO 8601 (YYYY-MM-DD)</li> </ul> <li>licenses - Array [optional]</li> <div>License object:</div> <ul> <li>name - String [required]</li> <li>unassignedAmount - Number [optional] - Number of licenses that are not assigned to users</li> <li>users - Array [optional]</li> <div>License user object:</div> <ul> <li>email - String [required] - user's email</li> <li>licenseStatus - Enum ( active/inactive/deleted ) [optional] - If not provided, will be defined by user status</li> </ul> <li>pricePerUser - Number [optional] - should be sent in cents (will be saved in the organization's display currency) </li> <ul> </ol> </details> <details> <summary>File example</summary> <pre> { "users": [ { "id: "15893", "email": "adam@example.com", "firstName": "Adam", "lastName": "Test", "status": "active", "externalStatus": "Active", "roles": ["Admin", "Super admin"], "lastUsedDate": "2021-07-05T20:43:14Z" }, { "id": "39471", "email": "tony@example.com", "firstName": "Tony", "lastName": "Example", "status": "active", "externalStatus": "Deactivated", "roles": ["Member"], "lastUsedDate": "2021-05-05T14:43:14Z" } ], "licenses": [ { "name": "Pro", "unassignedAmount": 10, "users": [ { "email": "adam@example.com", "licenseStatus": "active" } ], "pricePerUser": 15000 }, { "name": "Basic", "unassignedAmount": 5, "users": [], "pricePerUser": 0 }, { "name": "Corp", "unassignedAmount": 20, "users": [ { "email": "tony@example.com", "licenseStatus": "inactive" } ], "pricePerUser": 20000 } ] }</pre> </details> <p><ul><li>Rate limit: 200 requests per minute</li></ul></p>
put/services/sync/custom

Request

  • Base URL
    https://api.toriihq.com/v1.0
  • Auth
    API key in header Authorization

Request body

idFileinteger required

Unique file identifier

idAppAccountinteger required

Unique app account identifier

Example request

{
  "idFile": 1000,
  "idAppAccount": 1000
}

Changes

No recorded changes to this operation across all 1 revision of this API.