Skip to content

Manual Integration of Passport with Resolver

Yen Le Diep Hoang edited this page Sep 14, 2023 · 2 revisions

Requirement

Overview

The GS1 Digital Link converts a barcode into a web address. This repository provides the capability to create a comprehensive resolver service, enabling you to input information related to GTINs and other GS1 keys. It allows you to redirect web clients to their respective destinations. When creating a GS1 Resolver, you will add a passport to the targetURL field and use 'application/json' as the mimeType.

Request with cURL to create a resolver:

curl --location 'http://localhost/resolver' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 5555555555555' \
--data '[
    {
        "identificationKeyType": "gtin",
        "identificationKey": "8935001810087",
        "itemDescription": "Meat product",
        "qualifierPath": "/",
        "active": true,
        "responses": [
            {
                "linkType": "gs1:pip",
                "ianaLanguage": "en",
                "context": "au",
                "mimeType": "application/json",
                "linkTitle": "Asset Information Page",
                "targetUrl": "https://agtrace-passports.s3.ap-southeast-2.amazonaws.com/COO-passport.json",
                "defaultLinkType": true,
                "defaultIanaLanguage": true,
                "defaultContext": true,
                "defaultMimeType": true,
                "fwqs": false,
                "active": true
            }
        ]
    }
]'

Explain the Body of the Request:

  1. Identification Key Type (e.g. '01' for GTIN) - Application identifiers
  2. Identification Key Value (the GTIN's 14-digit barcode value (8-, 12- and 13-digit GTINs are zero-padded to make them 14-digits))
  3. Qualifier Path (often just the root path "/" but GTINs can have CPVs, lot numbers and serial numbers in the path, each separated by "/")
  4. LinkType (a word from the GS1 Web Vocabulary describing what sort of information is being requested. e.g. Product Info? User Manual?)
  5. Language (in which the information is authored in)
  6. Context (which in Community Edition can be any appropriate data value - in GS1 GO Resolver this is 'territory' such as 'FR' for France)
  7. MimeType or MediaType (how the information is formatted. e.g. 'text/html', 'application/json', using 'application/json' in this case)
  8. Target URL (link to the passport)

Reference: