Administration API
The Administration API is used to provision and manage accounts that will store your customers data as well as manage app connection information. Each account is isolated from one another unless access is granted via sharing settings or setting the datashare
flag when creating the account.
A Postman collection is available to use this API at the bottom of this page
This API is NOT used to access the chart of accounts of a company or any company data like a balance sheet. It is only used to manage accounts to store your customers data. See API for accessing your customers data.
Accounts
Creating Accounts
You can create a new account via a POST request (using basic auth) to https://admin.myintranetapps.com/app/api.php with an "Account-Key" header set to "XXXX" (where XXXX is your account key) that contains a JSON body that looks like:
{
"name": "new client name",
"package_id": "9",
"active": "1",
"email_admin": "newaccountadmin@email.com",
"password": "newadminpassword",
"subdomain": "example",
"type": "standard",
"domain": "www.redirect.com",
"datashare": "1"
}
Parameter | Definition |
---|---|
| The human readable name of the company you are adding an account for, typically the legal name. This is displayed to the user. |
| Specifies an identifier for a collection of account settings called a `package`. If no |
| A flag that indicates you want this account to be active on creation. Either 0 or 1. |
| Address that indicates the email we should use for communication to the manager of the account, reasons for sending an email might include sending system service/maintenance notices or requests to re-authorize an integration if access has been revoked for some reason. |
| Used to allow the default "admin" account to login with the given password, leave this blank to disable admin login. |
| Required as each new account is accessible under its own subdomain of myintranetapps.com, the text you specify here will be used to create a domain like "my-company.myintranetapps.com". Must be 50 characters or less and use alphanumeric characters and dashes only. If the subdomain is already in use by another account, the request will fail with a 409 response:
CODE
In this case, the request should be retried with a new subdomain. |
| Indicates the account type which is either "reseller" or "standard", for your purposes you should leave this as βstandardβ. |
| An optional field used when you want to add a custom (DNS CNAME) domain name to the system instead of using the myintranetapps.com domain, you shouldn't need this field and can leave blank. If you have not previously setup a DNS CNAME entry for your custom domain do not provide a value in this field or the account creation will not succeed. |
| Indicates that you want the account setup with permissions already active to allow full sharing with the master account, this should be set to "1" for your use case. |
The response you get back will be in JSON and look like:
{
"status_code":200,
"message":"Account successfully created",
"account_key":"<<<UNIQUE_KEY>>>",
"subdomain":"example",
"account_domain":"example.myintranetapps.com",
"name":"new client name",
"admin_email":"newaccountadmin@email.com"
}
You should save the unique key for future reference in your system, you will use this unique account key whenever you need to interact with this account in the future
Listing Accounts
You can list all accounts previously created via a POST request (using basic auth) to https://admin.myintranetapps.com/app/api.php with an "Account-Key" header set to "XXXX" (where XXXX is your account key) that contains a JSON body that looks like:
{
"action": "list_accounts"
}
The response you get back will be in JSON and look like:
{
"status_code":200,
"message": "Accounts list successfully generated",
"accounts":[
{
"name": "General Company Ltd",
"key": "5a70d8fcd44aa9.76285892",
"subdomain": "generalco",
"domain": "",
"package_id": "93",
"email_admin": "cfo@example.com"
}
]
}
Updating Accounts
You can update an account previously created via a POST request (using basic auth) to https://admin.myintranetapps.com/app/api.php with an "Account-Key" header set to "XXXX" (where XXXX is your account key) that contains a JSON body that looks like:
{
"action": "update_account",
"account_key": "5a70d8fcd44aa9.76285892",
"package_id": "9",
"active": "1",
"email_admin": "newaccountadmin@email.com"
}
Property called "account_key" must be set to the value of the account key of the account to update. Following properties of the JSON posted are optional: "package_id", "active", "email_admin", but there must be at least one property set to perform an update.
The response you get back will be in JSON and look like:
{
"status_code":200,
"message":"Account successfully updated",
"account_key": "5a70d8fcd44aa9.76285892"
}
If something goes wrong while processing your POST request ("status_code" value will differ from 200), the "message" property will contain an error description.
Connections
Connection Health
To get a list of all app connections and their current status create a GET request (using basic auth) to https://admin.myintranetapps.com/app/api.php?action=connection_health with an "Account-Key" header set to "XXXX" (where XXXX is your account key).
The response you get back will be in JSON and look like:
{
"status_code": 200,
"message": "Connection health generated",
"count": 2,
"connections": [
{
"integration": "quickbooks",
"property": "Sandbox Company_US_1",
"expires": "2021-11-05 19:02:23",
"created": "2019-06-26 22:39:47",
"status": "INACTIVE",
"environment": "sandbox",
"last_sync": "2021-10-12 16:20:38",
"last_sync_error": null,
"last_sync_error_count": null,
"last_sync_error_message": null,
"active": false,
"name": "Dev Startup",
"account_key": "5aa2e93c0ea374.82746293",
"in_error_state": false
},
{
"integration": "quickbooks",
"property": "Boss Widgets Inc",
"expires": "2021-11-05 19:02:23",
"created": "2021-11-05 18:02:23",
"status": "ACTIVE",
"environment": "production",
"last_sync": "2022-05-02 04:05:59",
"last_sync_error": "2022-01-20 04:05:50",
"last_sync_error_count": "0",
"last_sync_error_message": "warning: failed to make request to quickbooks, code:200",
"active": true,
"name": "testborrower",
"account_key": "6170841d16cc84.92698341",
"in_error_state": false
}
]
}
The response contains the following fields:
Field | Definition |
---|---|
integration | The unique identifying key for a particular app |
property | Some apps manage access to multiple properties/accounts via a given set of credentials. For many apps this field will be blank but for those that support accessing different properties the name of the property will be the value of this field. |
expires | The date and time the current access token expires. Access tokens are refreshed automatically |
created | The date and time this app connection was created in UTC |
status | The current status of the app connection. One of: |
environment | The app connection environment, typically this is either βproductionβ or βsandboxβ depending on the account settings |
last_sync | The date and time of the last full synchronization for this app in UTC |
last_sync_error | The date and time of the last full synchronization that resulted in an error in UTC |
last_sync_error_count | The number of sequential errors that have occurred when performing full synchronization, this counter resets to 0 when a successful synchronization occurs. Automatic synchronization will pause when 10 attempts at synchronization fail. |
last_sync_error_message | The technical error message indicating the reason for an error |
active | Whether or not this app connection is an active connection (true) or has been disconnected (false). Deprecated - use βstatus' instead |
name | The name of the account associated with the connection |
account_key | The account key associated with the connection |
in_error_state | Whether or not the connection is currently considered in error, 0 or 1 |
Fetching connection information for a specific account
Adding an additional GET parameter named account_key
will limit the result set to only contain connections for the given account, e.g. https://admin.myintranetapps.com/app/api.php?action=connection_health&account_key=5aa2e93c0ea374.82746293
Filtering connections based on status
Adding an additional GET parameter named statuses
will filter the result set based on status. The statuses
parameter should be a comma separated list of statuses you want to include in the response. For example, https://admin.myintranetapps.com/app/api.php?action=connection_health&statuses=ACTIVE would only return ACTIVE connections in the response.
https://admin.myintranetapps.com/app/api.php?action=connection_health&statuses=PENDING,INACTIVE would only return PENDING and INACTIVE connections in the response.
Valid values that can be included in the comma separated list are ACTIVE, PENDING, or INACTIVE.
Postman Collection
Administration.postman_collection.json
Collection environment variables:
Variable | Value | Description |
---|---|---|
admin_subdomain | admin | Unless you have a custom domain this should be set to |
baseurl | myintranetapps.com myintranetapps.ca | Either |
account_key | <YOUR ACCOUNT KEY> | The unique alphanumeric key assigned to your account. This will be sent in the header of each API request. e.g. |
username | <YOUR USER NAME> | A user from your account that is part of the admins group |
password | <YOUR PASSWORD> | The password of your user |