Test API Access / Get API Token via MI API Test Tool
This article describes how you can quickly test your API access.
Table of contents:
1. Obtain External Application ID And Key
Access Admin > System > External Applications
- Open the External Application to be tested
- Copy the ID value of the External Application from the URL
- In our example the ID value of the 'App for API' application is 1, as seen in the URL
- Copy the values of the Application ID and Application key
- NOTE: Application ID and the ID value from the URL are two different values.
2. Open API Toolkit
Access Admin > System > API Toolkit
- Select the item depending on the request you need to create. This example demonstrates how to obtain token via API request.
- All Methods available for this item are shown in this field (in our example only the POST method is available)
- Enter ID value from the URL of your External Application
- See Obtain External Application ID And Key for details
- Once the ID is entered, the system automatically generates a Raw request
NOTE: Beginning v7.0.2, application_id
and application_key
values must be provided manually additionally to the user
value.
3. Complete and Run Raw Request to Get API Token
Alternately, you can use JSON requests.
- Assign values to the following parameters:
-
application_id
: External Application ID- NOTE: This value is different from the External Application's ID from the URL. See Obtain External Application ID And Key for details.
-
application_key
: External Application key- See Obtain External Application ID And Key for details.
-
user
: Username- Username can be found under Admin > Users & Groups > Select a User from the Users grid > Locate Username under the Info tab.
-
- Optionally, you can define the response format in the Accept field
NOTE: In v6, XML or JSON response formats can be selected for Raw request or Form Request, the 'text/csv' format is only applicable for 'metric_data' and 'report_data' Items.
- [Run request] at the top of the page
- The Token is returned and displayed in the Raw response field
4. Get API Token via JSON Request
- Select JSON request format
- Assign values to the following parameters:
-
application_id
: External Application ID- NOTE: This value is different from the External Application's ID from the URL. See Obtain External Application ID And Key for details.
-
application_key
: External Application key- See Obtain External Application ID And Key for details.
-
user
: Username- This value can be found under Admin > Users & Groups > Select a User from the Users grid > Locate Username under the Info tab.
-
- [Run Request]
- The request returns the API Token in Raw response field
5. Get API Token via XML Request
NOTE: Beginning v7.0.1, XML requests are deprecated and no longer executed. Use JSON as a standard format instead.
- Select XML request format
- Enter Username in the
<user>
field- Username can be found under Admin > Users & Groups > Select a User from the Users grid > Locate Username under the Info tab
- [Run Request]
- The API Token is returned in Raw response field