Skip to content

ION Script

Welcome to the NSA Professional Services GitHub repository. This script is a sample script that reads a Sync.PurchaseOrder BOD and creates an IDM search item API request in json format.

Feel free to use and modify the script to suit your needs


This is an ION Script that you can import into your own ION desk scripting application.

Project layout

docs/
    mkdocs.yml                # The configuration file.
    docs/
        index.md              # The documentation homepage.
        ...                   # Other markdown pages, images and other files.
    createRequest.py          # Python classes to build the IDM API request 
    Sync.PurchaseOrder.xml    # Sample Sync.PurchaseOrder BOD
    TUG_2022_GetPONo.json     # Script that can be imported into ION Desk / Scripting

Setup

  • In ION Desk, go to Scripting
  • Select Scripts
  • Select Import*

Import Script

  • Select TUG_2022_GetPONo.json file

Upload File

  • To test the script in ION Scripting, import the Sync.PurchaseOrder.xml file under the testing tab.

Input

  • Select the Test button
  • Select YES, SAVE & TEST
  • Preview the results

Output

The request payload that is generated can be used for an IDM "Items" POST request.

It is valid for the followig endpoints:

* /items/count  
* /items/search  
* /items/search/item/resource  
* /items/search/item/resource/stream  
* /items/search/item/resource/{conversion}  
* /items/search/item/resource/{conversion}/stream

Feel free to try it out, change it suit your needs or add it to a project of your own.