In this article:
Requirements
- A user account in Frontdoor configured with API keys. For more information, see API keys and Frontdoor: Overview and FAQs.
- The user account must be in the Frontdoor auth domain where the Cost Transparency (CT) application resides.
- Key must be granted access to appropriate environment after it is created. Click "Grant Access" link next to key name.
- The user must have a Power User role for CT access, and possibly DataLink Admin privileges if the same account is to be used in both applications. If Power User role is not standard one or was modified, be sure permissions are set for the role to Allow Access to environments and Allow Export.
- Cost Transparency application with the user access (mentioned above) to the environment.
- The Postman application for this example. Similar applications, such as SoapUI, can be used via the same principals.
User in Frontdoor

(Click to enlarge)
Set up a Postman environment
This procedure allows you to save environment variables within Postman. This is useful to chaining together different requests in support of testing so that you don't have to copy and paste the apptio-opentoken repeatedly.
To set up the environment:
- Create a new Postman environment.

- Set the appropriate environment variables. In the following images, we use "env", "pub", "secret", and "token".
env - This is blank to start - it gets populated later.
pub - The public component of your API key.
secret - The secret component of your API key.
token - This is blank to start - it gets populated later.

Obtain an Opentoken from Frontdoor
For documentation about this example, see API: Authentication via API keys.
Post request URL: https://frontdoor.apptio.com/service/apikeylogin
Headers:
Accept: application/json
Content-Type: application/json

Body (NOTE: Set body to raw format by selecting proper radio button):
{"keyAccess":"{{pub}}","keySecret":"{{secret}}"}

Under "Tests", set the following. This will set the value of your "token" environment variable when the POST executes:
var t = postman.getResponseCookie("apptio-opentoken").value;
pm.environment.set("token", t);

Click Save and then click Send for this POST. You should now see the apptio-opentoken in the cookies:

And in your environment variables:

Using Username/Password to authenticate
Using API Keys is the preferred method for authentication for security reasons. However, if you are using a username and password instead of API Keys, you must create environment variables for the user ID and password. Then, the body will appear similar to the following example:

For more information, see Basic authentication in Frontdoor using username/password.
GET the Environment ID
The call to get environment ID is not needed if you already know what the ID is. ID does not change unless Application like CT frontdoor configuration is modified. For more information, see API: Get Frontdoor Environment Information.
NOTE: Be sure to substitute your domain name for the placeholder "yourdomain.com" and your front door environment name (this is typically "main") for the placeholder "yourfrontdoorenv" in the following URL:
GET request URL: https://frontdoor.apptio.com/api/environment/yourdomain.com/yourfrontdoorenv
Headers:
content-type: application/json
apptio-opentoken: {{token}}

Use the following in the "Tests":
var jsonData = pm.response.json();
pm.environment.set("env", jsonData.id);
Click Save and then click Send. You should see the environment ID in the body:

And in your environment's variables:

Upload a Table
For more information, see the examples in Introduction to the Apptio Platform API.
POST request URL: https://domain.apptio.com/biit/api/v1/domain.com/Project%20Name/Test%20Table/Jan%3AFY2017/overwrite
Headers:
content-type: application/json
apptio-opentoken: {{token}}
apptio-current-environment: {{env}}

In the Body, specify the file to upload:

Click Save, and then click Send. If everything is set correctly, you should get some json in the response body that looks similar to this example:

Download a Table
For more information, see the examples in Introduction to the Apptio Platform API.
NOTE: Be sure to substitute values appropriate to your situation in the following sample URL:
GET request URL: See the Table section of API: Downloading data for details on how to obtain a table API URL.
Headers:
content-type: text/tab-separated-values
apptio-opentoken: {{token}}
apptio-current-environment: {{env}}

Download a Report Table
GET request URL: See API: Downloading data for details on how to obtain a reportAPI URL.
Headers:
content-type: text/tab-separated-values
apptio-opentoken: {{token}}
apptio-current-environment: {{env}}

For more API information, see About Apptio API.
(Back to top)
This topic is open for your feedback. At the bottom of this screen, click Add a comment.