Invoking IFS Aurena projections from 3rd part tools like Postman has been a challenge so far and my current finding so far is that calling a projection requires session cookies and it does not work with OAuth2 token.
I was searching for alternate ways of invoking IFS Auera calls and found that the Postman Interceptor is really cool tool and you can invoke all IFS Aurena invokes without any addition step. Here are the steps you need to follow in order to capture Aurena invokes with postman.
What Will Cover…
- Setting up Postman Interceptor
- Capturing IFS Aurena requests
- Some Tips…
Setting up Postman Interceptor
Download and install the Postman Chrome extension
verify whether you have it installed in the Chrome Extensions
Open Postman and click on the Satellite Icon
- Go to the Requests tab ,Toggle Source to the Interceptor. If the Interceptor extension is properly installed, you can see the Interceptor Connected with green dot
- Toggle Capture Requests to ON
- Select an Collection to save the requests
- If you have many tabs open, it’s good to have some filter to define, but tit’s not mandatory.
Now go to the Cookies tab, set Capture Cookies ON and add your IFS domain
Now we are all set with setup capturing IFS requests with Postman!
Capturing IFS Aurena requests
We’ll see how to capture the Aurena requests Master Part record
Capturing Aurena Server Requests for Query a Part Record
Login to IFS Aurena client using Chrome as usual and navigate to Master Part > Part page and search for a part No.
You should see the captured requests in the Interceptor Chrome extension and typically the call on top should be the corresponding server call to GET the part details.
Open Postman and check the collection you specified the requests to save in previous step. You can see all the server calls made from Login until the Part record is retrieved. This can use as a alternate troubleshoot tool in addition to IFS debug console.
Open the GET request for PartHandling.svc/PartCatalogSet. As you can see everything you need to execute the request from Postman is already there (Query parameters, column list, Auth headers, cookies) and you can Invoke the request.
Note: If it return HTTP 401, logout from IFS and login again. I’m not sure what happens underneath but it seems like the cookies are incorrect. When you re login to IFS Aurena, Interceptor will refresh cookies and it worked for me.
Capturing Aurena Server Requests for Creating a New Part Record
Similar to querying the Master Part record, create a new part and Save in IFS Aurena.
Check the request in Postman. You can see how the input JSON looks like for a new master part record. By changing the part No, we should be able to create new parts in IFS.
Capturing Aurena Server Requests for Deleting a Part Record
Similarly, delete request can also captured and send from Postman but deleting a record required the key (part_no) and the etag.
ETAG can be obtained using below query format
SELECT 'W/"' || utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('W/"' || objid || ':' || objversion || '"'))) || '"' etag FROM PART_CATALOG WHERE PART_NO = 'TEST01'
Modify the If-match header with the ETAG and then should be able to execute the DELETE operation
I’ve noted that the following cookies should be available to properly execute the request without errors.
If the cookies are missing, then you can re-generate them by Logout from Aurena, clearing cookies from Internet Options and login again.
If you get any error like below, most possible cause could be token mismatch.
"code": "CSRF_ERROR", "message": "A security error occurred while processing the request."
To avoid this error, check the XSFR-TOKEN cookie and see if it matches the X-XSRF-TOKEN header value
Hope you find this post useful and will add some value for IFS Aurena debugging and developments. Please comment with your thoughts on any suggestions and improvements needed.
Thank you. This is very useful information for anyone.
Thank you Oshada