Uniform-Resource-Name-Pattern (URN) in path parameters

With fulfillmenttools it is possible to supplement the platform-generated entity ID with your own. This can be used in the REST API resource paths for addressing purposes in order to cater for easy access and fewer requests needed overall.

Get entity with URN-Pattern

Typically, a fulfillmenttools entity is referred by its entity id, which is generated by the platform upon creation and is immutable. Furthermore, a tenant ID can be specified when creating (here tenantFacilityId):

{
    "id": "54df9aa2-42ec-47a4-9d5a-29d1387be8fa",
    "tenantFacilityId": "NO-5678-22",
    ...
    "version": 1
}

The id could be used to get the entity by API, here, for example, the facility entity:

GET /api/facilities/54df9aa2-42ec-47a4-9d5a-29d1387be8fa

The introduction of the URN-Pattern for usage in paths introduces the possibility to address an entity by its tenant ID, which is basically a foreign key in another system, as long as this value is unique.

Hence, the above call could also be done by issuing the following request:

GET /api/facilities/urn:fft:tenantFacilityId:NO-5678-22

The two tokens of the identifying value (tenantFacilityId in this case) are:

  • urn:fft:tenantFacilityId: Refers to the URN path according to the standard URN Pattern (see RFC 8141 for more information)

  • NO-5678-22: Is the tenantFacilityId of the facility itself. The uniqueness of this value is being provided by fulfillmenttools

Last updated