Skip to main content
Skip table of contents

API Keys

Add API Key

You can create a new API Key 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:

JSON
{
  "action": "add_key",
  "name":"a test key",
  "scope":["admin.account.create","admin.account.update"],
  "active": "1"
}

Parameter

Definition

action
REQUIRED

Must be set to “add_key”

name
REQUIRED

The human readable name of the API Key you are adding. This is only used to help you differentiate keys

scope
REQUIRED

Specifies an array of the features and/or data this API key will be able to access

active
REQUIRED

A flag that indicates you want this API Key to be active on creation. Either 0 or 1.

The response you get back will be in JSON and look like:

JSON
{
	"status_code": 200,
	"message": "New API Key Added Successfully",
	"key": "sk_vtL5a3SXOSi89QR.IIsj7OTWOlYt6RPxTmeTdRqViHWi4B8h"
}

You should save the key for future reference in your system, you will use this unique key whenever you need to interact with this account in the future

If something goes wrong while processing your POST request ("status_code" value will differ from 200), the "message" property will contain an error description.

Error responses

HTTP response status

Error message

Description

400

Bad Request

Check that you are sending a standard “Host” header in your request

401

missing name or scope

Listing API Keys

To get a list of all API Keys create a GET request (using basic auth) to https://admin.myintranetapps.com/app/api.php?action=listing_keys 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:

JSON
{
	"status_code": 200,
	"message": "API Key Listing",
	"count": 2,
	"keys": [
		{
			"name": "Test Key 1",
			"key": "sk_Stezb",
			"id": 134,
			"active": 0,
			"created": "2022-07-27 20:53:37",
			"modified": "2022-07-27 21:09:49",
			"api_scope": [
				"account.create",
				"integration.connect"
			]
		},
		{
			"name": "Test Key 2",
			"key": "sk_96wAU",
			"id": 135,
			"active": 1,
			"created": "2022-07-27 21:10:05",
			"modified": "2022-11-15 04:19:16",
			"api_scope": [
				"api.read",
				"api.write",
				"integration.connect"
			]
		}
	]
}

The response contains the following fields within the keys field:

Field

Definition

name

A human friendly reference name used to help distinguish different keys

key

The first few characters of the API key. Note it is not possible to retrieve the entire API key for security purposes.

id

The unique system identifier of this API Key

active

A value of 1 indicates this key can be used, a value of 0 indicates the key is inactive.

created

The date and time this app connection was created in UTC

modified

The date and time this app connection was last modified in UTC

api_scope

An array of scopes this API key has authorization for, i.e. the actions this API key is entitled to do.

If something goes wrong while processing your GET request ("status_code" value will differ from 200), the "message" property will contain an error description.

Error responses

HTTP response status

Error message

Description

400

Bad Request

Check that you are sending a standard “Host” header in your request

405

HTTP request method not allowed

Action (parameter “action”, for example “listing_keys”) is not supported

Update API Key

You can update an API Key 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:

JSON
{
  "action": "update_key",
  "id": 136,
  "name":"a new key name",
  "scope":["admin.account.create","admin.account.update"],
  "active": 1
}

Parameter

Definition

action
REQUIRED

Must be set to “update_key”

id
REQUIRED

The ID of the API Key you want to update

name
REQUIRED

The human readable name of the API Key you are updating. This is only used to help you differentiate keys

scope
REQUIRED

Specifies an array of the features and/or data this API key will be able to access

active
REQUIRED

A flag that indicates you want this API Key to be active. Either 0 or 1.

The response you get back will be in JSON and look like:

JSON
{
	"status_code": 200,
	"message": "API Key Updated Successfully",
	"id": 136
}

If something goes wrong while processing your POST request ("status_code" value will differ from 200), the "message" property will contain an error description.

Error responses

HTTP response status

Error message

Description

400

Bad Request

Check that you are sending a standard “Host” header in your request

401

missing id, name or scope

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.