As mentioned in the Getting Started, you'll need the following access to get yourself an API token:
- A Valid Project Insight workspace*
- An API URL from your Project Insight workspace
- System Administration privileges to generate your own API Token OR a token generated by a System Administrator to maintain your permissions
*TIP: If you are Creating, Updating or Deleting records, you should definitely test your integration on a Sandbox Testing Environment and not your production site. If you are just reading or getting data, go right on ahead, you won't mess anything up.
Authentication
Project Insight uses an API token to identify an authenticated user on the server.
Find the API URL and token in the Administration section as follows:
Create a REST API Token
You'll need an API token to validate any API requests. This is either done in your application's interface or in the code by query string or within the request header.
When you click the button, a layer will ask you create a token based on a user's permissions.
API Permissions, is only defined by the user permission in which the context of the API token was created. Consult with the User System Roles of the person creating the API token to ensure you have the needed access.
If using this token for READ access for reports, you can identify a "User Context" to mimic the permissions PI should follow when we "get" report data.
If using this token for an application, we recommend creating a specific API user instead of just using an existing user account. Therefore, actions done using the API are clearly identifiable.
Using Token to Make REST Call
When making a REST call you must use "YOUR TOKEN" with the key "api-token".
The token can be placed in 1 of 2 locations when making a REST Call. It can be a Header or Query parameter (we recommend Header parameter to avoid query string length issues and readability of URL). Regardless of your choice, header or query, the "key" that must be used is "api-token". The key is "api-token" and the value is "YOUR TOKEN".
Some applications will only give you the option to add a URL and not modify the header parameters this would be the use case for placing the token in the URL (query parameter) as follows:
https://demo.projectinsight.net/api/project/active?api-token="YOUR TOKEN"
Now let's build
Our team designed Project Insight's APIs to identify object models and their properties. When you understand the Model Properties formats you'll have access to unlimited Project Insight data.
Comments
0 comments
Please sign in to leave a comment.