Get Resources

Introduction

Review information to one or all Resources (business objects that within the UI are broken down into Customers, Equipment, Items or Suppliers) within a Resource Category (how Resources are organized in a hierarchy).

Getting Started

All API requests require an authorization token – reference our Authentication page for more information

API Structure

POST api/integration/GetResources

Required Request Parameters

Name

Location

Options

Description

Authorization token

Header

See Login Authentication API documentation

Take

Body

Recommended default 100

Paging the data

Skip

Body

Recommended default 0

Paging the data

PageSize

Body

Recommended default 100

Paging the data

Resourcetype

body

"Items", "Customer", "Equipment", "Supplier"

Business Objects referred to as Resources collectively within SafetyChain

Logic

body

"And", "Or"

Conditional logic, used when pulling multiple Resource Types

Filters

Body

If filtering is not in use this field must be left blank.

Request JSON

{
  "Data": {
    "Take": 100,
    "Skip": 0,
    "PageSize": 100,
    "ResourceType": [
      "Suppliers"
    ],
    "Filter": {
      "Logic": "And",
      "Filters": []
    }
  }
}

Response Parameters

NameDescription
IDGUID that can be used in other API requests
NameThe name within the UI, used within other API requests
FullNameFull path of where the Resource is located within the UI's hierarchy
FieldValuesAdditional information about the one or more Fields associated with this resource
IsEnabledResource Enabled Status (enabled/disabled within the UI)
IsVisibleDenotes if this field is visible within the UI
IsEditableDenotes if this field can be modified
ResourceTypeIDGUID
ResourceTypeUsed to verify resource was created in the correct Resource Type (Customers, Items, Equipment, Suppliers)
ParentBusinessObjectFullNameUsed to verify the resource was introduced in the correct level of the Resource's Categories (hierarchy within the UI)
RequestErrorError object providing information if an error occurs
StatusIndicating the success of the API request

Response JSON

**Note: **This response has been abbreviated due to length and the abbreviations are denoted with the "…" syntax.

{
    "Data": [
        {
            "Id": "dd5ce7c0-56a1-4ab4-975f-245b16def058",
            "Name": "Hillcrest Nut Co.",
            "FullName": "Suppliers > Suppliers > Hillcrest Nut Co.",
            "Order": 21,
            "FieldValues": [
                {
                    "OrderNo": 2,
                    "FieldTypeName": "ToggleButton",
                    "DefaultValue": 255,
                    "IsEditable": true,
                    "IsVisible": true,
                    "IsRequired": false,
                    "MaxLength": 255,
                    "HasDataSource": false,
                    "IsEnabled": true,
                    "DataSource": null,
                    "FieldId": "2adcba74-9ad0-428f-961f-bf12194f444e",
                    "FieldName": "Status",
                    "Value": "true"
                }
            ],
            "IsEnabled": true,
            "ResourceTypeId": "0b91c344-cda7-4133-a852-3c1cc2d6c1b0",
            "ResourceType": "Suppliers",
            "ParentBusinessObjectFullName": "Suppliers > Suppliers",
            "ParentBusinessObjectId": "32d57bb6-7ff2-47b4-9b40-41a321fcfad1",
            "LocationLinks": {
                "Links": null
            }
        },
        {...}
        },
        {...}
    ],
    "RequestError": null,
    "Status": true,
    "Errors": null,
    "RefreshToken": false
}

Miscellaneous

The Filters area can be modified to reference a single Resource within a Resource Category. The examples below outline how to setup these filters to pull a single Supplier Resource from the Supplier Resource Category and how to do a partial search when you’re unsure of a resource’s name.

Partial Complete Resource Name - Request JSON

**Note: **This response has been abbreviated due to length and the abbreviations are denoted with the "…" syntax.

{
    "Data": {
        {...}
        "ResourceType": ["Items"],
        "Filter": {
            "Logic": "And",
            "Filters": [
                {
                    "Field": "FullName",
                    "Value": "Oat",
                    "Operator": "contains"
                }
            ]
        }
    }
}

This would return a response for Oatmeal and any other items that happen to have oat within the Resource name (Oats, Oats and Flakes, etc.).

Optional Request Parameters for filtering

NameLocationDescription
"Field": "FullName",Body within FiltersPulls the full path of the Resource Category
"Value": "",Body within FiltersInclude the name of the Resource or Resource Category. In the example below, Crisp Inc is the name of a Supplier Resource
"Operator": "contains"Body within FiltersRequired logic.

Request JSON: Single Supplier Resource within a Category

{
  "Data": {
    "Take": 100,
    "Skip": 0,
    "PageSize": 100,
    "ResourceType": [
      "Suppliers"
    ],
    "Filter": {
      "Logic": "And",
      "Filters": [
        {
          "Field": "FullName",
          "Value": "Crisp Inc",
          "Operator": "contains"
        }
      ]
    }
  }
}

Response JSON

{
    "Data": [
        {
            "Id": "a103d98e-d9f4-4815-9766-2f1a8b5f3e45",
            "Name": "Crisp Inc.",
            "FullName": "Suppliers > Suppliers > Crisp Inc.",
            "Order": 20,
            "FieldValues": [
                {
                    "OrderNo": 2,
                    "FieldTypeName": "ToggleButton",
                    "DefaultValue": 255,
                    "IsEditable": true,
                    "IsVisible": true,
                    "IsRequired": false,
                    "MaxLength": 255,
                    "HasDataSource": false,
                    "IsEnabled": true,
                    "DataSource": null,
                    "FieldId": "2adcba74-9ad0-428f-961f-bf12194f444e",
                    "FieldName": "Status",
                    "Value": "true"
                }
            ],
            "IsEnabled": true,
            "ResourceTypeId": "0b91c344-cda7-4133-a852-3c1cc2d6c1b0",
            "ResourceType": "Suppliers",
            "ParentBusinessObjectFullName": "Suppliers > Suppliers",
            "ParentBusinessObjectId": "32d57bb6-7ff2-47b4-9b40-41a321fcfad1",
            "LocationLinks": {
                "Links": null
            }
        }
    ],
    "RequestError": null,
    "Status": true,
    "Errors": null,
    "RefreshToken": false
}