Use the Project Insight ExternalObject with IntegrationObjectMap and IntegrationDefinition for integrations to external programs.
Set up the rules for mapping the ExternalObject to a Project Insight item in the IntegrationObjectMap.
The ExternalObject contains the IDs, hyperlinks and other information that may be needed for an integration to the external program.
Items in Project Insight can have multiple ExternalObjects to integrate with multiple external programs. This allows for flexibility.
Multiple integrations of external programs can share the information stored in Project Insight. The External Object is a representation of the item’s information from an external program. Therefore, Project Insight's item will map to a corresponding item in a different program.
A link in Project Insight will connect the user (and the developer) to the corresponding external item. Please continue reading additional information the external objects property models.
Add an ExternalObject
To setup your IntegrationDefinition, IntegrationObjectMap, and IntegrationObjectMap id for your integrations:
- In Project Insight, go to Administration > Integration
- If you do not see the Administration section, please contact your Project Insight Administrator to do this for you
- If this is your first time mapping other applications, watch the Set-Up video
- At the bottom of that page
- Set up your IntegrationDefinition and IntegrationObjectMap
- You will need the “MAP ID:” (Also known as IntegrationObjectMap_Id in the API)
- Copy that MAP ID and set it aside
- You will need for creating ExternalObject
Then you just make the API call to create the ExternalObject here is an example in CURL
curl -X POST \ https://WORKSPACE.projectinsight.net/api/external-object \ -H 'Content-Type: application/json' \ -H 'api-token: TOKEN' \ -H 'cache-control: no-cache' \ -d '{ "IntegrationObjectMap_Id":"INTEGRATIONOBJECTMAP_ID", "InternalObjectId":"ID_ITEM_IN_PI", "ExternalObjectId":"ID_FOR_ITEM_IN_OTHER_SYSTEM", "Name":"API TEST" }'
Notice the JSON that must be passed through the body of the POST command.
The “InternalObjectId” should be the a Project Insight item of the same type picked during the making of the “IntegrationObjectMap”.
The only required fields to create the ExternalObject are
- “IntegrationObjectMap_Id”
- “InternalObjectId”
- “ExternalObjectId”
The rest of the fields can be used as needed for your integration. You can see the other fields for ExternalObject.
Another way to add an ExternalObject
Directly on the Project Insight Item you are trying to use.
Take advantage of the IdExternal object on a Project Insight Item during a save on the API.
This can be useful because you can do both saves in one call. Here is example of how you would do this in CURL
curl -X POST \ https://WORKSPACE.projectinsight.net/api/project \ -H 'Content-Type: application/json' \ -H 'api-token: API_TOKEN' \ -H 'cache-control: no-cache' \ -d '{ "Id":"PROJECT", "IdExternal":{ "Id":"PARAM_1", "Id2":"PARAM_2", "IdContainer":"ID_OF_CONTAINER", "IntegrationMapId":"INTEGRATIONMAP_ID", } }'
Important things to note about using the IdExternal:
- “Id” and “Id2” are the first two parameters from the ExternalObjects
- There is no “name” option
- ID will display as whatever was put in “Id” until a name is added
- Although you can save this method, you will only be able to READ the data
- e.g. in the example above, the READ of this project idExternal will be null
Comments
0 comments
Please sign in to leave a comment.