FactoryLogix Learning

Get started with the xTend API

KB ARTICLE

Overview

The FactoryLogix xTend API is a REST interface that allows external systems to interact with FactoryLogix programmatically. This article describes the communication channels, URL structure, and how to establish a connection and make API calls.

Communication channels

The REST interface supports two communication channels:

Channel

Format

URL pattern

JSON

JSON request and response

http://[myserver]:6063/FactoryLogix_xTendAPIService/json/[ServiceName]/[Method]

XML (POX)

XML request and response

http://[myserver]:6063/FactoryLogix_xTendAPIService/pox/[ServiceName]/[Method]

  • Replace [myserver] with the name of the server running the FactoryLogix xTend API Service.

  • Replace [ServiceName] with the relevant service namespace and [Method] with the specific method to call.

Available services

Services are organized into namespaces, each containing methods for a specific category of operations.

  • To view the methods available in a given namespace, append /help to a URL containing that namespace.

Note

A complete list of services, their descriptions, and the licenses required to use them is available in the FactoryLogix xTend API documentation.

Prerequisites

  • The FactoryLogix xTend API Service is running on the target server.

  • Valid FactoryLogix credentials are available.

  • An API client such as Postman is installed. The Postman desktop installer is available at https://www.postman.com/downloads/.

Connect and retrieve a session ID

All API interactions require an active session.

  • Use the Connect method in the ConnectionServices namespace to establish a session.

Example connect endpoint:

http://[myserver]:6063/FactoryLogix_xTendAPIService/json/ConnectionServices/Connect


Example JSON request body:


{
  "serverName": "grichards",
  "userName": "aegisadmin",
  "password": "",
  "databaseConnection": "FactoryLogix"
}


A successful connection returns a ConnectResult response containing a sessionID value. Record this value; it is required for all subsequent API calls.

Troubleshoot connection errors

If you receive an error at the connection stage, verify the following:

  • The xTend API service is running on the selected server.

  • The credentials entered are correct.

  • All parameter names in the request body are spelled correctly.

Make an API call

  • Once connected, use the sessionId returned by the Connect method in the body of subsequent requests. The following example calls the GetItem method:


{
  "sessionId": "5b4b049d-478d-e30c-db68-08d8a25b8399",
  "itemUID": "tool1g"
}

Disconnect

  • To end a session, call the Disconnect method:

http://[myserver]:6063/FactoryLogix_xTendAPIService/json/ConnectionServices/Disconnect


Example request body:


{
  "sessionId": "5b4b049d-e6a9-9926-d624-08d8d41cfbf2"
}

Useful connection service methods

Method

Description

GetDatabaseConnections

Returns a list of database connection names associated with the server.

GetDefaultDatabaseConnection

Returns the name of the default database connection for the server.