API Interface to Cloudsuite Distribution Enterprise
Overview
Send procured requisition data to Infor M3 for product integrations, initiate workflows, and trigger alerts using the ION Messaging Service.
This tutorial is designed for users with no prior experience with Infor M3 or those without access to the system. It guides them through the process of sending procured requisition data to M3 to perform tasks such as integrating ERP/Non-ERP applications, initiating workflows, and triggering alerts. The tutorial explains how to use ION Messaging Service APIs to transmit requisition data or any BOD (Business Object Document) to Infor OS.
Requirements
- Access to an Infor CloudSuite
- User privileges to ION
- Security role: IONDeskAdmin
- User privileges to API Gateway
- Security role: IONAPI-Administrator
- User privileges to M3
Tutorial
Difficulty: Medium
Estimated completion time: 45 Minutes
Configuration
STEP 1: Create an Authorized App of Backend Service Type in ION API.
Download the .ionapi file which will serve as credentials at a later point.
Login to Infor OS Portal. Click the API Gateway tab, on the navigation menu click the Authorized Apps option, and click the (+) option.
On the Non-Infor New Authorized App page, In the Name field enter Build_IMS. Select the Backend Service option for Type and enter a Description of For build portal tutorials. Click Save.
Scroll to the bottom of the Build_IMS page and select the Download Credentials button.
On the Download Credentials page, enable the Create Service Account option, type and select the Full Name of your user account that will be associated with the service account. Click Download.
The Build_IMS.ionapi file will be downloaded to your downloads folder on your workstation.
Open the Build_IMS.ionapi file in an editor.
You should see something like this.
For the steps mentioned above, refer to the video below.
STEP 2: Create an IMS connection point. The user must create an IMS connection point to send data to ION.
NOTE: Users can skip this section if they have a predefined connection point.
Select the ION tab. On the navigation menu, expand Connect and select the Connection Points option. Click on the “+ Add” symbol.
Select the IMS via API Gateway option.
On the Infor Application Connection Point (IMS via API Gateway) page, In the Name field, enter Build_IMS. Enter a Description of For build portal tutorials. Under the Connection tab, Uncheck the Application has IMS End Point option and fill in the ION API Client id field with the ci value from the Build_IMS.ionapi file.
Select the Documents tab, click the (+) button, and on the Add Documents page use the Filter option to select the Sync.Requisition document name. Click Ok.
Click Save.
Notice after you Save the connection point it will be Active.
For the steps mentioned above, refer to the video below.
STEP 3: Create a Document flow
NOTE: Users can skip this section if they have a predefined Document Flow.
Go to ION, expand Connect, and then select the Data Flows option. Click on the “+ Add” symbol and select Document Flow.
Populate the Name field with BuildPortal_IMS value, and enter Description. Drag two Application blocks between START and END.
The First application is the connection point which was created in the previous step.
In the Name field of Application1 type Postman to IMS, enter a Description of For sending document from Postman to IMS.
Add the connector by clicking on the “+” symbol and using the Filter field select the Build_IMS Application. Click Ok.
Here is the setup of the Postman to IMS Application.
The second application that receives documents is M3. It is a predefined connector in ION.
Add the connector by clicking on the “+” symbol and using the Filter field select the m3 Application. Click Ok.
Here is the setup of the M3 Connector Application.
Click on the document symbol between two applications and add the predefined documents /object schemas.
Click Save.
Activate the Document flow.
For the steps mentioned above, refer to the video below.
SECTION 2 : CALLING IMS API USING POSTMAN
Generating Access Token: An Access token must be generated as the IMS API uses OAuth 2.0 authorization.
In Postman, create a New request.
In the Authorization tab, select type as OAuth 2.0.
Scroll down in the Current Token section and fill in the details from the ‘.ionapi’ file.
- Token Name – <Readable Name>
- Grant Type – From the drop down select Password Credentials
- Access Token URL – Value of “pu”+ “ot” from the downloaded IONAPI file.
- Client ID – Value of “ci” from the downloaded IONAPI file.
- Client Secret – Value of “cs” from the downloaded IONAPI file.
- Username – Value of “saak” from the downloaded IONAPI file.
- Password – Value of “sask” from the downloaded IONAPI file.
Click on Get new Access Token button, which generates a token, and then Click on “Use token“
For the steps mentioned above, refer to the video below.
STEP 2: Call the IMS API
Change the request method to POST and enter the Request URL for IMS.
Example Request URL: https://mingle-ionapi.inforcloudsuite.com/<tenantName>/CustomerApi/IMSV3Wrapper/Messaging/v3/multipartMessage
Example:
In the Request Body, select the format “form-data“.
For the first parameter, fill the KEY as “ParameterRequest” and VALUE is a file. This file “InputHeaders‘ should be in JSON format, created by specifying the parameters along with their values as described below:
- “documentName” : Name of the file/document to be sent to ION
- “messageId” : A unique number for user identification
- “fromLogicalId” : LogicalId of the connection point created in step 3
- “toLogicalId” : default
- “charset” : “UTF-8”
Use content below for InputHeaders.json file.
{
“documentName” : “Sync.Requisition”,
“messageId” : “123456”,
“fromLogicalId” : “lid://infor.ims.build_ims”,
“toLogicalId” : “lid://default”,
“encoding” : “NONE”,
“characterSet” : “UTF-8”
}For the second parameter, fill the KEY as “MessagePayload” and for VALUE, select the file to be sent into ION which would be a BOD XML. Set the ‘CONTENT TYPE‘ header to ‘application/octet-stream‘.
Click on “Send“. The Response Body will be displayed with the Status Code.
For the steps mentioned above, refer to the video below.
This completes the end-to-end simulation for this tutorial.
Appendix
- This tutorial assumes the user intends to send a Standard pre-defined BOD in ION to M3. However, if the user intends to send a custom BOD/Document to ION, they are required to follow the below additional step as STEP 2 and continue with the remaining steps.
STEP 2: Create an Object Schema. The user must define the document which must be sent to ION.
Click on the ION tab, and from the navigation menu expand Data Catalog and select Object Schemas.
NOTE: The Object Schema for the Purchase Order or Requisition which must be sent to IMS is defined here.
Click on the “+” symbol and then select “Generate From Sample Data”.
Select the file to upload.
Refer to the video below for further steps.
- This tutorial explains how to make API calls to IMS V3 Multipart Messaging service, however, the user may choose to use IMS V2 Messaging service(https://mingle-ionapi.inforcloudsuite.com/DEVMRKT_DEV/CustomerApi/IMSWrapper/send/v2/message) for these API calls based upon his/her requirement.
Troubleshooting
Common errors and troubleshooting tips for errors generated in Postman.
- Error: 401 Unauthorized: If the user faces this error, he/she has to select the “Authorization” tab, select OAuth2 to generate a proper access token, and use it before proceeding with the API call as mentioned in step 1: Generating Access Token.
- Error: 404 Not Found: This error occurs when the Request URL is wrong and the User has to include the value of “Content-Type” as “application/octet-stream” for “MessagePayload” in the Request Body and also the user has to ensure that the “BODY” of the call is properly defined before proceeding with the API Call.
- 400 Bad Request: Invalid client ID: This error occurs when the user doesn’t enter the client ID generated in the .ionapi file in the client ID field of the Connection point and the user must ensure the client ID in for authorization in the POSTMAN call matches the client ID value in the connection point. Confirm the “ci” value from the downloaded .ionapi file.
Resources
Online help documentation:
- ION
- POSTMAN https://www.postman.com/
- IMS – Infor Application Connector
- M3