# SyteLine ION API IDO Request Generator

> Source: https://netray.co/tools/syteline-ion-api-ido-request-generator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Turn a .ionapi backend service file into working PowerShell and curl calls that load SyteLine IDO data through ION API, including bookmark paging.

## Category

developer

## Erp

Infor SyteLine

## Audience

- Integration engineer
- SyteLine developer
- ERP administrator

## Tool

**Kind:** template

**Output:** code

**Language:** powershell

**Fields:**

#### Path to .ionapi file

**Key:** ionapi_path

**Type:** text

**Default:** C:\secure\syteline_backend.ionapi

#### ION API suite path

**Key:** suite_path

**Type:** text

**Default:** CSI/IDORequestService

**Help:** Copy the exact path from the Available APIs list in ION API Gateway for your tenant.

#### Mongoose configuration name

**Key:** config

**Type:** text

**Default:** TENANT_PRD_DEM

#### IDO

**Key:** ido

**Type:** text

**Default:** SLItems

#### Properties

**Key:** props

**Type:** text

**Default:** Item,Description,UM

#### Filter

**Key:** filter

**Type:** text

**Default:** Item LIKE 'PN-%'

#### Record cap per page

**Key:** recordcap

**Type:** number

**Default:** 200

#### Maximum pages to fetch

**Key:** max_pages

**Type:** number

**Default:** 50

**Blocks:**

#### 1. PowerShell: token, load and bookmark paging

**Body:** [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$ionapiPath = '{{ionapi_path}}'
$suitePath  = '{{suite_path}}'
$config     = '{{config}}'
$ido        = '{{ido}}'
$props      = '{{props}}'
$filter     = "{{filter}}"
$recordCap  = {{recordcap}}
$maxPages   = {{max_pages}}

# The .ionapi file is a secret: it holds the client secret and service account keys.
$c = Get-Content -Raw -Path $ionapiPath | ConvertFrom-Json

# OAuth2 password grant with the backend service account access and secret keys
$tokenUrl = $c.pu + $c.ot
$body = @{ grant_type = 'password'; username = $c.saak; password = $c.sask; client_id = $c.ci; client_secret = $c.cs }
$tok = Invoke-RestMethod -Method Post -Uri $tokenUrl -Body $body

$headers = @{
  Authorization            = 'Bearer ' + $tok.access_token
  'X-Infor-MongooseConfig' = $config
  Accept                   = 'application/json'
}

$base  = $c.iu.TrimEnd('/') + '/' + $c.ti + '/' + $suitePath.Trim('/') + '/ido/load/' + $ido
$query = '?properties=' + [uri]::EscapeDataString($props) + '&filter=' + [uri]::EscapeDataString($filter) + '&recordcap=' + $recordCap

$all  = @()
$resp = Invoke-RestMethod -Method Get -Uri ($base + $query) -Headers $headers
if (-not $resp.Success) { throw $resp.Message }
$all += $resp.Items
$page = 1

while ($resp.MoreRowsExist -and $page -lt $maxPages) {
  $next = $query + '&loadtype=NEXT&bookmark=' + [uri]::EscapeDataString($resp.Bookmark)
  $resp = Invoke-RestMethod -Method Get -Uri ($base + $next) -Headers $headers
  if (-not $resp.Success) { throw $resp.Message }
  $all += $resp.Items
  $page++
}

"Rows loaded: " + $all.Count
$all | Select-Object -First 20 | Format-Table -AutoSize

#### 2. curl and jq equivalent (bash)

**Body:** # Path to the same .ionapi file on the Linux or WSL host that runs this script
F='/secure/syteline_backend.ionapi'
PU=$(jq -r .pu "$F"); OT=$(jq -r .ot "$F")
IU=$(jq -r .iu "$F"); TI=$(jq -r .ti "$F")
CI=$(jq -r .ci "$F"); CS=$(jq -r .cs "$F")
SAAK=$(jq -r .saak "$F"); SASK=$(jq -r .sask "$F")

TOKEN=$(curl -s -X POST "$PU$OT" \
  --data-urlencode grant_type=password \
  --data-urlencode "username=$SAAK" \
  --data-urlencode "password=$SASK" \
  --data-urlencode "client_id=$CI" \
  --data-urlencode "client_secret=$CS" | jq -r .access_token)

curl -s -G "$IU/$TI/{{suite_path}}/ido/load/{{ido}}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Infor-MongooseConfig: {{config}}" \
  -H "Accept: application/json" \
  --data-urlencode "properties={{props}}" \
  --data-urlencode "filter={{filter}}" \
  --data-urlencode "recordcap={{recordcap}}" | jq '.MoreRowsExist, .Bookmark, (.Items | length)'

# Next page: add --data-urlencode "loadtype=NEXT" --data-urlencode "bookmark=<Bookmark value>"

**Notes:** Uses the .ionapi fields ti, ci, cs, iu, pu, ot, saak and sask from a backend service credential, and the Mongoose REST v2 load call with the X-Infor-MongooseConfig header, which is required when calling through ION API. Verify the suite path segment for SyteLine / CSI in ION API Gateway (Available APIs) on your tenant or on-premises ION API, and the configuration name. Request a new token before expires_in runs out on long jobs.

## Content

**Intro:** This generator builds PowerShell and curl calls that load SyteLine / CSI IDO data through the Infor ION API gateway using a downloaded .ionapi credentials file. It handles the token request, the Mongoose configuration header and bookmark paging.

**Sections:**

#### How to use it

**Body:** In ION API Gateway, create an authorized backend service application, add a service account and download the credentials as a .ionapi file. Store it where only the integration account can read it. Copy the SyteLine suite path from the Available APIs list into the suite path field, because the segment differs between tenants and on-premises ION API installs. Fill in the Mongoose configuration name, IDO, properties and filter, then run block 1. It prints the row count and the first rows; remove Select-Object to keep everything.

**Bullets:**

- The configuration name is the Mongoose configuration, not the tenant id.
- Properties and filter use IDO property names.
- Keep max pages as a safety stop for unexpected large loads.

#### What the .ionapi fields mean

**Body:** The file is JSON. ti is the tenant, ci and cs are the client id and secret, iu is the ION API base URL, pu is the authorization server base and ot is the token endpoint path appended to it, and saak and sask are the service account access and secret keys used as username and password in the OAuth2 password grant. The token response carries access_token and expires_in. Every IDO call then sends Authorization: Bearer plus X-Infor-MongooseConfig naming the configuration, because the gateway does not know which Mongoose configuration you mean otherwise.

#### Paging with bookmarks

**Body:** A load returns Items plus MoreRowsExist and Bookmark. When MoreRowsExist is true, repeat the same request with loadtype=NEXT and the returned bookmark to get the next page, until MoreRowsExist is false. For example, if 1,150 items match the filter, the defaults fetch them in six pages of up to 200 rows. Keep the same properties, filter and order between pages; changing them mid-stream makes the bookmark meaningless. For large extracts, schedule the job off-hours and filter by date or key ranges rather than loading an entire IDO.

#### Gotchas

**Body:** A 401 usually means an expired token or a wrong token URL built from pu and ot. A response with Success false and a message about the configuration means the X-Infor-MongooseConfig header is missing or wrong. A 404 almost always means the suite path does not match what the gateway publishes. Filters with quotes and percent signs must be URL-encoded, which both blocks do. The service account runs with the permissions of the SyteLine user it maps to, so give it only the IDOs it needs.

**Cta:** If you want this data answered in plain English instead of scripted, we can connect a private assistant to the same SyteLine IDOs on infrastructure you control.

**Faq:**

#### What is a .ionapi file?

**Answer:** It is the JSON credentials file ION API Gateway lets you download for an authorized app. For a backend service it contains the tenant, client id and secret, the ION API and authorization URLs and the service account keys. Treat it like a password: it grants API access without any user signing in.

#### Why is X-Infor-MongooseConfig required?

**Answer:** Through ION API, the gateway routes to the Mongoose application but does not choose a configuration for you. The header names the configuration, for example the production or test site configuration, so the IDO request service knows which database and site the call targets. Direct calls to the on-premises REST service handle configuration differently.

#### How many rows does one load return?

**Answer:** As many as the record cap allows. In Mongoose, -1 means the default of 200 rows and 0 means all rows; a positive number sets the page size. Use a positive cap with bookmark paging for large sets, so each request stays small and a failure only costs one page.

#### Does this work for on-premises SyteLine?

**Answer:** Yes, if your site runs ION API on-premises and the SyteLine IDO request service is published through it. The flow is the same; the URLs in the .ionapi file point at your servers. Without ION API, call the IDO REST service directly with its own token endpoint.

## Search terms

syteline ion api, infor mongoose rest api, infor mongoose api, ionapi file token, x-infor-mongooseconfig, csi ido load ion api, syteline rest api oauth2

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
