QueryString params?

127 views
Skip to first unread message

John Doherty

unread,
Jan 31, 2023, 8:25:01 AM1/31/23
to GS1 Digital Link Developers
Hello all, me again :) Looking at the following example:Screenshot 2023-01-31 at 13.22.33.png
What are the rules for when an AI should be part of the URL path, verses the query string? or are they interchangeable?

Thanks 

d...@evrythng.com

unread,
Jan 31, 2023, 8:50:15 AM1/31/23
to GS1 Digital Link Developers
Hi John,

The rules are described in the ABNF grammar in the standard or in the files on GitHub here: https://github.com/evrythng/digital-link.js/tree/master/grammar

You can also test what goes into the path and what goes into the query string by having at look at the digital link playground here: https://digital-link.tools/

Cheers,

Dom

Mark Harrison

unread,
Jan 31, 2023, 8:54:14 AM1/31/23
to GS1 Digital Link Developers
Hi John,

The rules about whether an AI should be part of the URI path or the URI query string can be found in https://ref.gs1.org/standards/digital-link/uri-syntax/ formally defined using ABNF grammar in chapter 4 and with examples in chapter 5.  They're not interchangeable.  Whereas GS1 element strings may have an ordering depending on whether the AI and its value is of 'predefined length' (see GS1 Gen Specs v23 section 7.8.3 and figure 7.8.5-2 ), GS1 Digital Link uses a different ordering, putting the primary identifier in the URI path info and data attributes in the URI query string.

Within the part of the URI path info that is characteristic of GS1 Digital Link URIs, only GS1 Application Identifiers that are primary identification keys (simple keys such as SSCC (00), GTIN (01), physical location GLN (414)  or compound keys such as GTIN (01) + Lot (10), GTIN (01) +Serial (21), GLN (414) + GLN extension (254)) should appear within the URI path information, in a well-defined order when multiple AIs form a compound identification key.  Other AIs (such as expiration date (17)) that represent data attributes always appear only within the URI query string.

Best wishes

Mark

John Doherty

unread,
Jan 31, 2023, 9:46:05 AM1/31/23
to GS1 Digital Link Developers
Thank you both

Jason Hale

unread,
Jan 31, 2023, 11:44:01 AM1/31/23
to John Doherty, GS1 Digital Link Developers
This is a much better answer than mine 😃👍

Sent from Outlook for iOS

From: gs1-digital-l...@googlegroups.com <gs1-digital-l...@googlegroups.com> on behalf of John Doherty <jo...@orcascan.com>
Sent: Tuesday, January 31, 2023 2:46:05 PM
To: GS1 Digital Link Developers <gs1-digital-l...@googlegroups.com>
Subject: [GS1 DL Devs] Re: QueryString params?
 
--
You received this message because you are subscribed to the Google Groups "GS1 Digital Link Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gs1-digital-link-de...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/gs1-digital-link-developers/28399413-8bb9-4f2f-96f3-ebb1ca768548n%40googlegroups.com.
CONFIDENTIALITY / DISCLAIMER:
The contents of this e-mail are confidential and are not to be regarded as a contractual offer or acceptance from GS1 UK Limited. GS1 UK Limited is a company limited by guarantee and registered in England and Wales under company number 01256140. Registered Office: Hasilwood House, 60 Bishopsgate, London EC2N 4AW. If you are not the addressee, or if this has been copied or sent to you in error, you must not use data herein for any purpose, must delete it, and should inform the sender. GS1 UK disclaims liability for accuracy or completeness, and opinions expressed are those of the author alone. GS1 UK may monitor communications. Third-party rights acknowledged. © 2022. All meetings held under the auspices of GS1 UK are subject to the GS1 UK Competition Policy. For more information about the usage of your data, please see our Privacy Policy and Cookie Policy.

Reply all
Reply to author
Forward
0 new messages