Hyperlink-Related Resource Representations

All resources use hyperlinked representations for related resource fields. These are the fields whose name ends with “_id”. They represent another entity resource that can generate its own representation using the hyperlink provided. Lgfapi uses hyperlinked relationships to allow for users to crawl to the intended data sets. This allows for the preservation of RESTful principals as well as to keep the data interchange sizes manageable.

All related field representations contain three pieces of information:

For example, when getting a representation for the “company” entity where the company is of type Regular, the related field “company_type_id” would be represented like the following JSON string:

{

“company_type_id”: {

“id”: 1,

“key”: “R”,

“url”: “https://…/wms/lgfapi/v10/entity/company_type/1”

},

}

Or, if the desired format is XML:

<company>

<company_type_id>

<id>1</id>

<key>R</key>

<url>https://.../wms/lgfapi/v10/entity/company_type/1</url>

</company_type_id>

</company>

The only exception for the related field representation format is for status_id related fields. These fields are always represented as only the related resource’s integer “id” value. It is possible to get a representation for any status-based entity by making a retrieve request. The only difference is that due to the volume of status fields on various entities, the integer value is used to reduce payload size.

For example, the “order_hdr” entity has the related field “status_id” for the entity “order_status”. It is represented on the “order_hdr” as just the “id” value:

{

“status_id”: 10,

}

However, it is possible to get a representation of the status by making the request:

GET https://.../wms/lgfapi/v10/order_status/10