ION Factory OS
  • Welcome to ION
  • Features
    • Procedures
      • Steps
        • Content
        • Datagrid
        • Fields
        • Attributes
      • Dependencies
      • Part-Procedure Relationship
      • Attributes
      • Standard Steps
      • Installation Requirements (Beta)
      • Nested Steps and Nested Standard Steps
      • Procedure Best Practices
    • Runs
      • Run Execution Overview
      • Runs And Step States
      • Batching Runs
        • Batching 2.0 Changes
      • Workcenter execution
      • Split Inventory on a Run
      • Redlines
      • Export run data
      • Scheduling runs
      • Time Tracking
      • Attributes
      • Outside Processing
      • Runs Best Practices
    • Parts Library
      • As-built Bill of Materials (aBOM)
        • Editing aBOM build requirements
        • aBOM Beta Changes
          • aBOM actions for developers
      • Inventory
        • Inventory status
        • Inventory splitting
        • Inventory merging
        • Inventory scrapping
        • Kitting
        • Inventory Movement Automations
      • Manufacturing bill of materials (mBOM)
        • mBOM versions
        • Made on Assembly (MOA)
        • Part Substitutes
        • Reference designators
      • Part Attributes
      • Part revision interchangeability
      • Supplier Part Numbers & Purchase Unit Conversions
    • Kitting and Inventory Fulfilment
      • Kit Statuses and Workflows
      • Inventory requests
      • Kitting and runs
      • Fulfilling Multiple Kits
      • Kanban Kitting
    • Purchasing
      • Purchase Orders
        • Types of Purchases
        • Purchase Order Approvals
        • Purchase Order FAQs
        • Supplier Part Numbers & Unit Conversions
        • PO Requirements, Terms, and Quality Clauses
      • Receiving/Inspection
      • Outside Processing
      • Consigned Parts
    • Barcode Labels
      • Templating
        • ION barcode minimum sizes
        • Sample templates
      • Printing
        • Configuring Zebra Browser Print
        • Server Based Barcode Printing (PrintNode)
      • Scanning
        • Scan barcodes from other systems
    • Quality
      • Issues
      • Further Actions - CAPA
      • Issues States, Dispositions, and Resolutions
      • Quality Best Practices
    • Tools
    • Locations
    • Attributes
    • Labels
      • Deleting labels
    • Notifications
    • Search
    • Settings
      • Role based access control
        • Full Glossary of ION Permissions
    • ION Actions
      • ION Actions examples for Quality
      • ION Actions examples for Runs and Procedures
      • ION ACTIONS examples for Supply Chain
  • Analytics
    • Inventory valuation
    • Part impact analysis
    • Users, Roles, Teams
    • Analytics FAQ
    • Data Connector
    • Data Products
  • Plans and Autoplan
    • Autoplan
    • Autoplan glossary
    • Preparing to use Autoplan
    • Clear to build reporting
    • Running Autoplan on a schedule
    • Firm and blocked plan items
    • Location constraints
    • Autoplan suggested suppliers and procedures
    • Reorder point
    • Plan input serial numbers
    • Applying a calendar
    • Plan Reservations
    • Independent schedules
    • Drive demand from kits
    • Drive demand below buy parts configuration
    • Group plan items with the same date
    • Manualy Changing Autoplan Status
  • API
    • How to create an App with ION
    • Access Tokens
    • About GraphQL
    • Interactive API explorer
    • API Keys
    • Examples
      • Notifications
      • Runs
      • Automatically updating fields in runs
      • Parts and Part Revisioning
      • mBOMs
      • Part Inventory and Kitting
      • aBOM (As-built Bill of Materials)
      • Edit time-tracking session data
    • Changelog
    • Webhooks
    • Pagination
  • Automations
    • Auto-checkout of Run Steps
    • Auto-Consumption of Lineside Inventory
    • Automatically Send Purchases to Suppliers
    • Set Close by Run Step on Issue Creation
    • Intent Management / Grade / Tier / Pedigree
      • Data Imprinting
      • ION Actions for Intent
    • Auto-Update mBOM Revision on Part Revision Update
    • Auto-approve part-procedure relationships
    • Purchase Order PDF and Versions
    • Auto Populate PO Line Attributes
    • Imprint Attributes from One Object to Another on a Desired Event
  • Integrations
    • Deploying Integrations and Automations
    • Arena
    • Cofactr
    • Datum
    • Duro
    • NetSuite
      • Purchasing in NetSuite, Receiving in ION
      • Work Order/Assembly Builds
    • Procurable
    • PDF Generator
    • Quickbooks
    • Ramp
    • Silkline Integration
    • Slack
    • Smartsheet
    • SOLIDWORKS
    • Teamcenter
  • Training
    • Standard Operating Procedures
      • Cycle Counting
      • Tool Utilization
    • Guided Flows
    • ION Sandbox
    • Chat Support for ION
  • Troubleshooting
    • Resetting your password
    • Resetting your Multi-Factor Authentication
    • You have no roles... error
  • Changelog
  • Adminstration
    • Security
      • Backups and Security FAQ
      • Single Sign-On (SSO)
        • Okta SAML connection setup
      • Export Control
      • Report Generator Disclaimer
    • Browser and Device Compatibility
    • Authentication
      • My company is new to ION, logging in for the first time.
      • I'm told I'm not authorized to access the application
      • My account has been deactivated
    • Login Page
  • Tickets Portal
Powered by GitBook
On this page
  • Step 1 - Generate an API key
  • Step 2 - Get an access token

Was this helpful?

  1. API

Access Tokens

Get and use access tokens to make API calls

PreviousHow to create an App with IONNextAbout GraphQL

Last updated 5 months ago

Was this helpful?

Step 1 - Generate an API key

Follow the to create an API key.

The API key will include a clientId and clientSecret.

Step 2 - Get an access token

Make the API call shown below and update the following variables:

  • CLIENT_ID: the clientId from the previous step

  • CLIENT_SECRET: the clientSecret from the previous step

  • AUTH_SERVER: The URI for the auth server (see table below)

App URI

Auth Server

API Endpoint

staging.firstresonance.io

or

sandbox.firstresonance.io

staging-auth.buildwithion.com

https://staging-api.buildwithion.com

app.firstresonance.io

auth.buildwithion.com

https://api.buildwithion.com

staging.ion-gov.com

or

sandbox.ion-gov.com

auth-staging-gov.buildwithion.com

https://api-staging-gov.buildwithion.com

app.ion-gov.com

auth-production-gov.buildwithion.com

https://api-production-gov.buildwithion.com

staging.ion-aus.com

auth-staging-aus.buildwithion.com

https://api-staging-aus.buildwithion.com

app.ion-aus.com

auth-production-aus.buildwithion.com

https://api-production-aus.buildwithion.com

$  curl -X POST \
        --data-urlencode "grant_type=client_credentials" \
        -d "client_id=CLIENT_ID" \
        -d "client_secret=CLIENT_SECRET" \
    https://<AUTH_SERVER>/realms/api-keys/protocol/openid-connect/token

The below also shows a very basic python script to query runs from ION.

To use, replace the following:

  • ACCESS_TOKEN: the access token from the previous step

  • API_ENDPOINT: The API endpoint for each environment are listed in the table above.

import requests
from urllib.parse import urljoin

access_token = <ACCESS_TOKEN>
api_endpoint = <API_ENDPOINT>


headers = {
    'Authorization': f'{access_token}',
    'Content-Type': 'application/json'
}

GET_RUNS = '''
{
    runs(first: 10) {
        edges {
            node { id title
                steps {
                    id
                    title
                }
            }
        }
    }
}
'''

query = {
    'query': GET_RUNS
}

res = requests.post(urljoin(api_endpoint, 'graphql'), headers=headers, json=query)
print(res.json())

to get your access token via python. We also have our public repository linked below for some sample scripts.

We have a for some API queries via python scripts.

If you are using a tool like Postman or Insomnia, be sure to add a /graphql to your end point. Example:

steps here
Here is a script
public repository published
https://staging-api.buildwithion.com/graphql