Description
This document has been created as a walk-through guide. Rest API is integrated in Intact iQ to provide outbound information, which can then be accessed as an endpoint API.
This is dependent on the definitions that are set up, which can be used to pull information that is in iQ. If the information is available in iQ, it can then be set up in a definition. All definitions have the read/write access.
Solution
Rest API can be accessed via the Company Tab—Setup. The menu has the following five options: API Definition; API Execution Log; API Log Entry; APIQueueEntry; and API User.
API Definition
This is where all definitions are created and stored. The definitions are used to expose information out of iQ. In the same principal, information can also be posted to iQ. Before creating any definitions, a hosting site and port number need to be defined (see below).
The description and code can be entered in accordingly.
- Within the Definition we have created, we can then create the services that we wish the API to have access to.
- The window below is a demonstrated set of services that we have in place. We will look at the first one as a main example: “Customers”
Within this service, we add in the following parameters:
Service Type: Standard
Target Type: The service we wish to choose in iQ, for example, Customers
Name: This is normally taken from the target type
Description: This is the information about the service within iQ and what it is going to be used for. The more information populated here, the more accurate it will be for an external web company/third party to access the endpoint.
Queue Processing Method: We can choose whether information is transmitted automatically into iQ or whether it waits in the Queue Entry screen.
Services: As this is a Restful API, we can choose which of the services can be enabled for each property we define:
- Get: Pull information from the property. For example, we can retrieve a list of customers based on the Code or Name.
- Put: Replace and update information toward the property in question. For example, updating the name of the customer.
- Post: Create an action, such as creating a new customer or sales order. However, keep in mind that you need to populate the properties below in order for it to work.
- Search: Using JSON syntax, properties can be picked and searched within the service setup.
- Delete: The ability to remove records from the definition we have set up.
Another feature within the Rest service is the ability to choose the conditions that the end user sees.
Under the Properties tab sits the actual objects within the service that we would like to set up. This is endless and there are no limits. The same logic applies. We choose the property, access level, and a description of the property. This information is then available on the API end point, which we will look at toward the end.
Once you are happy with the definitions in place, we can test the service by using “Run service test mode”
This brings us to the API page endpoint. This can be accessed by external third parties and it will allow them to see what you have built by accessing the “services” option.
So without the access of iQ, it can be seen what services are available through the API.
Furthermore, by clicking on the available services, we provide syntax that can be used to access the information in iQ from third-party applications such as “Postman.”
API Log Entry
The API Log Entry is where any of the services are called by an API User. This can be a Get, Push, Post, or Search. It shows the Key that is being used, which is an encryption key.
We have access to the contents that are being pushed through and the response message. If a method call fails (see above) we have the choice to “process auto,” which will force the contents through and disregard any validation. Process interactive will pop up with the validation or error for more investigation.
The API Key (see screenshot) indicates who has access to run these calls.
API User
In this section of the API, we can set up external or internal users who would need to access the API.
The encryption key, also known as a “bearer token” is then placed with the external JSON platform, which links to the rest API.
For more information and a detailed look at Intact iQ’s Rest API, please view this video.