Working with cross-reference lookup API requests

Introduction

The Patchworks API can be used to add and manage cross-reference lookups. Using the API you can work with:

Authentication

All API requests must be authenticated with a Patchworks bearer token. To obtain a token, send a POST request to the following endpoint:

https://svc-fabric.pwks.co/api/v1/login

In the request body, add the email and password that you use to log into the Patchworks dashboard. You should add this as JSON - for example:

{
    "email": "[email protected]",
    "password": "mypassword123*"
}

A successful response returns a token. Tokens are valid for 24 hours.

For detailed information about obtaining tokens, please see Obtaining a token for Patchworks API authentication.

Required cross reference details

The Patchworks cross-reference lookup API accepts two identifiers as parameters:

Parameter
Summary

{{id}}

The unique identifier associated with the cross-reference lookup.

{{valueID}}

The unique identifier associated with the cross-reference lookup row (also known as a mapping row).

id

Having selected a cross-reference lookup to view/edit, the unique id can be found at the end of the URL - for example:

valueId

Having selected a cross-reference lookup to view/edit, each existing lookup row is displayed with a unique valueId in the id column:

Lookups API

Retrieve a list all cross-reference lookups

Summary

Retrieve a list of cross-reference lookups that have been installed or added by your organisation.

URL

Required headers

Authorization : Bearer token

Sample request

Sample response (200 OK)

Retrieve a single cross-reference lookup

Summary

Retrieve basic details for a specific cross-reference lookup that has been installed or added by your organisation.

URL

Required headers

Authorization : Bearer token

Sample request

Sample response (200 OK)

Create a new cross-reference lookup

Summary

Create a new cross-reference lookup for your organisation. The lookup is created without any mapping rows.

URL

Required headers

Authorization : Bearer token

Body parameters

  • name (required) (string)

  • description (required) (string)

  • default_value (optional) (string)

Example:

Sample request

Sample response (200 OK)

Update a cross-reference lookup

Summary

Update basic details for a cross-reference lookup for your organisation.

URL

Required headers

Authorization : Bearer token

Body parameters

  • name (optional) (string)

  • description (optional) (string)

  • default_value (optional) (string)

At least one parameter must be passed into the request.

Example:

Sample request

Sample response (200 OK)

Delete a cross-reference lookup

Summary

Remove a cross-reference lookup (and all associated row values) for your organisation.

URL

Required headers

Authorization : Bearer token

Sample request

Sample response (200 OK)

Lookup rows API

Retrieve a list of mapping row values for a cross-reference lookup

Summary

Retrieve a list of row values for a given lookup that has been installed or added by your organisation.

URL

Required headers

Authorization : Bearer token

Sample request

Sample response (200 OK)

Retrieve mapping row values for a specific row within a cross-reference lookup

Summary

Retrieve mapping row values for a given row within a given cross-reference lookup that has been installed or added by your organisation.

URL

Required headers

Authorization : Bearer token

Sample request

Sample response (200 OK)

Create a new mapping row for a cross-reference lookup

Summary

Create a new mapping row for a cross-reference lookup that has been installed or added by your organisation.

URL

Required headers

Authorization : Bearer token

Body parameters

  • left_value (required) (string)

  • right_value (required) (string)

Example:

Sample request

Sample response (200 OK)

Update a mapping row for a cross-reference lookup

Summary

Update mapping row values for a cross-reference lookup that has been installed or added by your organisation.

URL

Required headers

Authorization : Bearer token

Body parameters

  • left_value (optional) (string)

  • right_value (optional) (string)

At least one parameter must be passed into the request.

Example:

Sample request

Sample response (200 OK)

Delete a mapping row for a cross-reference lookup

Summary

Remove a given mapping row for a cross-reference lookup that has been installed or added by your organisation.

URL

Required headers

Authorization : Bearer token

Sample request

Sample response (200 OK)

Last updated

Was this helpful?