https://resolver-dv1.gs1.org JSON update

93 views
Skip to first unread message

ni...@lansley.com

unread,
Nov 30, 2020, 6:23:57 AM11/30/20
to GS1 Digital Link Developers
Hi fellow GS1 Digital Link Developers

Just a message to let you know that I'll be updating the triallists resolver at
https://resolver-dv1.gs1.org today. All the code updates are internal except for one - and that is the new JSON format if you use linktype=all in the request.

The new format is far simpler than the original complex hierarchical format that we used when Resolver was 'born' nearly 3 years ago. That format was necessary because the service ran a lot slower 'back then' and needed to find the correct information as quickly as possible.

However, the rigid nature of the format made it inflexible for dealing with updates to the GS1 Digital Link standard, so the new format is a simpler and flexible successor.

However, if you are consuming this hierarchical JSON in your client applications then this is a breaking change. The good news is that you should be able to adjust your client pretty quickly because the new JSON format is so much simpler to consume. 

This doesn't change Resolver's standard redirect behaviour, only the linktype=all specific JSON data response, if you use it. 

This won't be the last time we alter this linktype=all JSON format - one of the new features we will be introducing soon is the ability to have multiple destinations rather than just one for each of the four resolving contexts (linktype, language, territory/context and media/MIME type). For example, a list of recipe websites rather than just one.

So, if you have client apps for devices which are from, say, Apple App Store or Google Play store that consume this JSON, good programming practice is for your client app to call into your own API on your servers which then places an onward call to Resolver. If we have to make a change to keep up to date with the standard then you only have to alter your API rather change every app.

Have a look at the new format that is already live on id.gs1.org using this example with the command-line URL tool 'curl':

curl -H "accept: application/json" https://id.gs1.org/01/09506000134352?linktype=all

{
"_id": "/01/09506000134352",
"unixtime": 1606376889,
"/": {
"active": true,
"itemDescription": "Dal Giardino Risotto Rice with Mushrooms 411g",
"responses": [
{
"link": "https://dalgiardino.com/where-to-buy/",
"title": "Where to buy",
"linkType": "gs1:hasRetailers",
"ianaLanguage": "en",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/where-to-buy/index.html.es",
"title": "Donde comprar Dal Giardino",
"linkType": "gs1:hasRetailers",
"ianaLanguage": "es",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/where-to-buy/index.html.vi",
"title": "Nơi bán",
"linkType": "gs1:hasRetailers",
"ianaLanguage": "vi",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/risotto-rice-with-mushrooms/",
"title": "Product information",
"linkType": "gs1:pip",
"ianaLanguage": "en",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": true,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/risotto-rice-with-mushrooms/index.html.es",
"title": "Información del Producto",
"linkType": "gs1:pip",
"ianaLanguage": "es",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/risotto-rice-with-mushrooms/index.html.ja",
"title": "Product information",
"linkType": "gs1:pip",
"ianaLanguage": "ja",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/risotto-rice-with-mushrooms/index.html.vi",
"title": "Trang thông tin sản phẩm",
"linkType": "gs1:pip",
"ianaLanguage": "vi",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/about/",
"title": "About Dal Giardino",
"linkType": "gs1:productSustainabilityInfo",
"ianaLanguage": "en",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/about/index.html.es",
"title": "Sobre Dal Giardino",
"linkType": "gs1:productSustainabilityInfo",
"ianaLanguage": "es",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/about/index.html.vi",
"title": "Phát triển bền vững và t",
"linkType": "gs1:productSustainabilityInfo",
"ianaLanguage": "vi",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/mushroom-squash-risotto/",
"title": "Wild Mushroom And Butternut Squash Risotto",
"linkType": "gs1:recipeInfo",
"ianaLanguage": "en",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/mushroom-squash-risotto/index.html.es",
"title": "Recetas",
"linkType": "gs1:recipeInfo",
"ianaLanguage": "es",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/mushroom-squash-risotto/index.html.ja",
"title": "キノコと砕いたバターナッツ入りのリゾット",
"linkType": "gs1:recipeInfo",
"ianaLanguage": "ja",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
},
{
"link": "https://dalgiardino.com/risotto-rice-with-mushrooms/lot/ABC/ser/123",
"title": "Traceability (item level)",
"linkType": "gs1:traceability",
"ianaLanguage": "en",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
}
]
},
"/10/ABC": {
"active": true,
"itemDescription": "Dal Giardino Risotto Rice with Mushrooms 411g",
"responses": [
{
"link": "https://dalgiardino.com/risotto-rice-with-mushrooms/lot/ABC/",
"title": "Traceability (batch level)",
"linkType": "gs1:traceability",
"ianaLanguage": "xx",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
}
]
},
"/10/ABC/21/123": {
"active": true,
"itemDescription": "Dal Giardino Risotto Rice with Mushrooms 411g",
"responses": [
{
"link": "https://dalgiardino.com/risotto-rice-with-mushrooms/lot/ABC/ser/123",
"title": "Traceability (item level)",
"linkType": "gs1:traceability",
"ianaLanguage": "xx",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
}
]
},
"/10/DEF": {
"active": true,
"itemDescription": "Dal Giardino Risotto Rice with Mushrooms 411g",
"responses": [
{
"link": "https://dalgiardino.com/risotto-rice-with-mushrooms/lot/DEF/",
"title": "Traceability (batch level)",
"linkType": "gs1:traceability",
"ianaLanguage": "xx",
"context": "xx",
"mimeType": "text/html",
"active": true,
"fwqs": true,
"defaultLinkType": false,
"defaultIanaLanguage": true,
"defaultContext": true,
"defaultMimeType": true
}
]
}
}




Reply all
Reply to author
Forward
0 new messages