Getting Started

If you are looking to build an integration or make some modifications to Project Insight, our APIs are the place to start.

A few prerequisites before starting:

  1. A Valid Project Insight Instance*
  2. A user login account (Username and Password only applies for older client versions)*
  3. An API Token. You'll find this in the API Settings page under Administration » Integration » API (REST)

*TIP: You should always develop your integration on a Sandbox Testing Environment and not your production site.

API Token

You manage your own API tokens in the Project Insight Admin interface at Administration » Integration » API (REST). The page lets you enable the API Token Access and view/update the API Token.

In order to access the REST API, you must generate an API Token and then pass the token with the header.

View the REST API Token for the User Context within your PI system.

Authentication

Project Insight uses an authentication ticket to identify an authenticated user on the server. Prior to using the API, your application must have an authentication token to verify the user identity for the REST calls.

cURL
	
		curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
		  "api-token": "{YOUR_PROJECTINSIGHT_API_TOKEN}"
		}' 'https://yourdomain.projectinsight.net/api/authenticate'
	

C#
	
		ProjectInsightWebApiClient client = 
			new ProjectInsightWebApiClient("http://yourdomain.projectinsight.net/api", "{api-token}");			
	
C# example (see C# client page for more info) that authenticates and returns a token if the user is valid.

Deprecated version, but still available for backwards compatibility
cURL
	
		curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
		  "Username": "{YOUR_PROJECTINSIGHT_USERNAME}",
		  "Password": "{YOUR_PROJECTINSIGHT_PASSWORD}",
		  "ApiToken": "{YOUR_PROJECTINSIGHT_API_TOKEN}",
		  "AuthorizationTokenTimeoutMinutes": 0
		}' 'https://yourdomain.projectinsight.net/api/authenticate'
	

C#
	
		ProjectInsightWebApiClient client = 
			new ProjectInsightWebApiClient("http://yourdomain.projectinsight.net/api", "{api-token}", "{username}", "{password}");			
	
C# example (see C# client page for more info) that authenticates and returns a token if the user is valid.

If the authentication is successful, an Authentication Token will be returned within the Response Body (Only applies to older client versions).

Authentication Token

You'll need an authentication token to validate any API requests (either by querystring or within the request header). By default, the authentication token lives 60 minutes, so you may set the AuthorizationTokenTimeMinutes property to extend the life of the token (Only applies to older client versions).

Online 12/9/2016