Support for comma delimited identifiers in the API?

Hi there.

I have been working with another REST API recently and one of the features is the support for comma delimited lists as part of a API request. From this example from the docs…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true)" -H "Accept:application/xml" -u admin:district -v

It would be useful to support this request as well…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31)&orgUnit=YuQRtpLP10I,vWbkYPRmKyS&children=true" -H "Accept:application/xml" -u admin:district -v

In some cases, we have many dozens or hundreds of orgunit UIDs in the requests, and it might be just a bit simpler to have these delimited.

Thoughts?

Regards,

Jason



Spring calls these Matrix Variables and is very easy to support using Spring MVC.
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.htm

I like the idea.

···

Regards,
Saptarshi PURKAYASTHA

On 11 December 2013 05:49, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there.

I have been working with another REST API recently and one of the features is the support for comma delimited lists as part of a API request. From this example from the docs…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true)" -H "Accept:application/xml" -u admin:district -v


It would be useful to support this request as well…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31)&orgUnit=YuQRtpLP10I,vWbkYPRmKyS&children=true" -H "Accept:application/xml" -u admin:district -v

In some cases, we have many dozens or hundreds of orgunit UIDs in the requests, and it might be just a bit simpler to have these delimited.

Thoughts?

Regards,

Jason






Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi Jason,

thanks for the suggestion. No doubt there is a need for a compact format for items.

Only problem is that the “,” character is defined as “reserved” in the URL “spec”:

http://www.ietf.org/rfc/rfc1738.txt p2.2

and causes e.g. spring mvc to split the value into multiple query params.

For analytics we use “;” for delimiting, which is also reserved, but is at least not causing trouble with spring mvc.

Would “;” be okay? If so please write a blueprint.

Lars

···

On Wed, Dec 11, 2013 at 5:49 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there.

I have been working with another REST API recently and one of the features is the support for comma delimited lists as part of a API request. From this example from the docs…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true)" -H "Accept:application/xml" -u admin:district -v


It would be useful to support this request as well…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31)&orgUnit=YuQRtpLP10I,vWbkYPRmKyS&children=true" -H "Accept:application/xml" -u admin:district -v

In some cases, we have many dozens or hundreds of orgunit UIDs in the requests, and it might be just a bit simpler to have these delimited.

Thoughts?

Regards,

Jason






Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Infact the , (comma) is meant to be used for this, as is mentioned here: http://tools.ietf.org/html/rfc3986#section-3.3 . See last paragraph, last 5 sentences.

Also Spring docs suggest using commas - http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-matrix-variables

···

Regards,
Saptarshi PURKAYASTHA

On 11 December 2013 13:13, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Jason,

thanks for the suggestion. No doubt there is a need for a compact format for items.

Only problem is that the “,” character is defined as “reserved” in the URL “spec”:

http://www.ietf.org/rfc/rfc1738.txt p2.2

and causes e.g. spring mvc to split the value into multiple query params.

For analytics we use “;” for delimiting, which is also reserved, but is at least not causing trouble with spring mvc.

Would “;” be okay? If so please write a blueprint.

Lars


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Dec 11, 2013 at 5:49 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there.

I have been working with another REST API recently and one of the features is the support for comma delimited lists as part of a API request. From this example from the docs…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true)" -H "Accept:application/xml" -u admin:district -v


It would be useful to support this request as well…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31)&orgUnit=YuQRtpLP10I,vWbkYPRmKyS&children=true" -H "Accept:application/xml" -u admin:district -v

In some cases, we have many dozens or hundreds of orgunit UIDs in the requests, and it might be just a bit simpler to have these delimited.

Thoughts?

Regards,

Jason






Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Looks reasonable to me.

···

On Wed, Dec 11, 2013 at 4:18 AM, Saptarshi Purkayastha sunbiz@gmail.com wrote:

Spring calls these Matrix Variables and is very easy to support using Spring MVC.
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.htm

I like the idea.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Regards,
Saptarshi PURKAYASTHA

On 11 December 2013 05:49, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there.

I have been working with another REST API recently and one of the features is the support for comma delimited lists as part of a API request. From this example from the docs…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true)" -H "Accept:application/xml" -u admin:district -v


It would be useful to support this request as well…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31)&orgUnit=YuQRtpLP10I,vWbkYPRmKyS&children=true" -H "Accept:application/xml" -u admin:district -v

In some cases, we have many dozens or hundreds of orgunit UIDs in the requests, and it might be just a bit simpler to have these delimited.

Thoughts?

Regards,

Jason






Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

I have no preference one way or the other.

I will write up a blueprint with all of the info on this thread though so we do not forget it :slight_smile:

Regards,

Jason

Infact the , (comma) is meant to be used for this, as is mentioned here: http://tools.ietf.org/html/rfc3986#section-3.3 . See last paragraph, last 5 sentences.

Also Spring docs suggest using commas - http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-matrix-variables

···

Regards,
Saptarshi PURKAYASTHA

On 11 December 2013 13:13, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Jason,

thanks for the suggestion. No doubt there is a need for a compact format for items.

Only problem is that the “,” character is defined as “reserved” in the URL “spec”:

http://www.ietf.org/rfc/rfc1738.txt p2.2

and causes e.g. spring mvc to split the value into multiple query params.

For analytics we use “;” for delimiting, which is also reserved, but is at least not causing trouble with spring mvc.

Would “;” be okay? If so please write a blueprint.

Lars


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Dec 11, 2013 at 5:49 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there.

I have been working with another REST API recently and one of the features is the support for comma delimited lists as part of a API request. From this example from the docs…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true)" -H "Accept:application/xml" -u admin:district -v


It would be useful to support this request as well…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31)&orgUnit=YuQRtpLP10I,vWbkYPRmKyS&children=true" -H "Accept:application/xml" -u admin:district -v

In some cases, we have many dozens or hundreds of orgunit UIDs in the requests, and it might be just a bit simpler to have these delimited.

Thoughts?

Regards,

Jason






Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

OK cool, wasn’t aware of matrix URIs.

···

On Wed, Dec 11, 2013 at 1:51 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

I have no preference one way or the other.

I will write up a blueprint with all of the info on this thread though so we do not forget it :slight_smile:

Regards,

Jason

Infact the , (comma) is meant to be used for this, as is mentioned here: http://tools.ietf.org/html/rfc3986#section-3.3 . See last paragraph, last 5 sentences.

Also Spring docs suggest using commas - http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-matrix-variables


Regards,
Saptarshi PURKAYASTHA

On 11 December 2013 13:13, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Jason,

thanks for the suggestion. No doubt there is a need for a compact format for items.

Only problem is that the “,” character is defined as “reserved” in the URL “spec”:

http://www.ietf.org/rfc/rfc1738.txt p2.2

and causes e.g. spring mvc to split the value into multiple query params.

For analytics we use “;” for delimiting, which is also reserved, but is at least not causing trouble with spring mvc.

Would “;” be okay? If so please write a blueprint.

Lars


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Dec 11, 2013 at 5:49 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there.

I have been working with another REST API recently and one of the features is the support for comma delimited lists as part of a API request. From this example from the docs…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true)" -H "Accept:application/xml" -u admin:district -v


It would be useful to support this request as well…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31)&orgUnit=YuQRtpLP10I,vWbkYPRmKyS&children=true" -H "Accept:application/xml" -u admin:district -v

In some cases, we have many dozens or hundreds of orgunit UIDs in the requests, and it might be just a bit simpler to have these delimited.

Thoughts?

Regards,

Jason






Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Blueprint registered here

https://blueprints.launchpad.net/dhis2/+spec/support-delimited-paramater-values-in-webapi

Regards,

Jason

···

On Wed, Dec 11, 2013 at 3:28 PM, Lars Helge Øverland larshelge@gmail.com wrote:

OK cool, wasn’t aware of matrix URIs.

On Wed, Dec 11, 2013 at 1:51 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

I have no preference one way or the other.

I will write up a blueprint with all of the info on this thread though so we do not forget it :slight_smile:

Regards,

Jason

Infact the , (comma) is meant to be used for this, as is mentioned here: http://tools.ietf.org/html/rfc3986#section-3.3 . See last paragraph, last 5 sentences.

Also Spring docs suggest using commas - http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-matrix-variables


Regards,
Saptarshi PURKAYASTHA

On 11 December 2013 13:13, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Jason,

thanks for the suggestion. No doubt there is a need for a compact format for items.

Only problem is that the “,” character is defined as “reserved” in the URL “spec”:

http://www.ietf.org/rfc/rfc1738.txt p2.2

and causes e.g. spring mvc to split the value into multiple query params.

For analytics we use “;” for delimiting, which is also reserved, but is at least not causing trouble with spring mvc.

Would “;” be okay? If so please write a blueprint.

Lars


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Dec 11, 2013 at 5:49 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there.

I have been working with another REST API recently and one of the features is the support for comma delimited lists as part of a API request. From this example from the docs…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true)" -H "Accept:application/xml" -u admin:district -v


It would be useful to support this request as well…

curl "[http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31](http://apps.dhis2.org/dev/api/completeDataSetRegistrations?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31)&orgUnit=YuQRtpLP10I,vWbkYPRmKyS&children=true" -H "Accept:application/xml" -u admin:district -v

In some cases, we have many dozens or hundreds of orgunit UIDs in the requests, and it might be just a bit simpler to have these delimited.

Thoughts?

Regards,

Jason






Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp