API - Introduction to PYXI API
Introduction
All API calls to the PYXI Core Engine are made by passing in data in JSON syntax. Most responses are received in JSON syntax, with a few exceptions e.g. the response to getting a file is to receive the file contents as a binary stream, not as JSON.
The URL to which all requests should be made is:
where 12345678 is your PYXI account number.
See sample PHP code below for example minimal code to manage API calls.
Making a Request
All requests include the following standard items:
- account – the PYXI account ID. This is generated and provided by the account set-up API call discussed later
- apikey – the unique key assigned to a particular DataSource (i.e. communicating application) set-up on this account. If you have not already done so, create a DataSource record named for the application from which you will make API calls. You will find an API key generated on that DataSource record.
- action – one of the available actions, discussed in the following sections
Depending on the action, additional information is almost always required.
Specifying a Single Record
For actions that are to be performed on a single record, the record can be specified in multiple ways
- By Record Url - if the url of a record is known, it can be provided as a single parameter in recordurl
- By Record Number - specify the record type in recordtype and the record id in recordid
- By Filter - specify the record type in recordtype and provide a filter condition in filter. The first record matching the filter condition will be used.
Specifying a List of Records
To specify a list of records, use some or all of the following:
- recordtype – the record type of the records to be listed. This is required.
- filter – optional filter condition. Only records matching the filter condition will be included
- sortby – optional name of method by which records should be sorted
- sortorder – optionally specify ‘desc’ to have records sorted in descending order, otherwise default is ascending order
- start – optionally specify the starting record number – usually used to enquire on ‘paged’ lists of records
- limit – optionally specify the maximum number of records to be included - usually used to enquire on paged lists of records
Standard Response Structures
Individual Record
An individual record response contains, at minimum, the following:
- recordurl – the unique record url string containing the record type and record id
- recordid – the unique numeric record id
- recordtype – the string type of the record
- name – the display name of the record (e.g. for a Person, this is "FirstName LastName")
If specific values have been requested, these are returned in a 'values' array. Note that a value response may be a discrete value or a Record List
Record List
A list of records is returned as an array containing the following:
- recordtype– the string type of the records in the list
- count – the number of records returned in this response
- total – the total number of records that match the list criteria. This can be higher than total if the list response has been restricted with a limit value
- records – an array of individual record responses
PHP Code
The code below provides a bare minimum class for making API calls to PYXI. It only assumes that the API Key and Account ID are available in environment variables - modify the code based on wherever you store such variables. You will doubtless want to expand this class with additional error-handling and/or to provide wrapper methods to individual API actions.
Sample PYXI API Class
Sample Call
Other API Help Pages
Introduction
IntroductionActions
Read a Record | Update a Record | Add a Record | List Records | Evaluate a Template | Execute an Action Script | Apply a Blueprint | Get a Blueprint | Add a File | Get a File | Get/Set a Persistent Setting Value | Get Category Values | Get Group Memberships of a User | Get Members of a Group | Load Data | Get Metadata for a Record Type | Get Metadata on Calculation Functions | Trigger an Event | Get Usage Statistics | Validate a Calculation | Validate a Filter ExpressionDiscussion Topics
Linking Records | Automation - Automations and EventsReturn to Developer Help