Proposed PUT/POST guidelines for REST APIs

Hey everyone,

As we continue to work on designing and implementing REST APIs for the different services, Josh and I would like to propose guidelines for PUT and POST endpoints. I quickly wrote up a document outlining the proposal. It is on the wiki at:

https://openlmis.atlassian.net/wiki/display/OP/OpenLMIS+v3+REST+API+proposed+guidelines+for+POST+and+PUT

Feedback is appreciated.

Shalom,

Chongsun

– ​

There are 10 kinds of people in this world; those who understand binary, and those who don’t.

Chongsun Ahn | chongsun.ahn@villagereach.org

Software Development Engineer

Village****Reach* ** Starting at the Last Mile*

2900 Eastlake Ave. E, Suite 230, Seattle, WA 98102, USA

DIRECT: 1.206.512.1536 **CELL: **1.206.910.0973 FAX: 1.206.860.6972

SKYPE: chongsun.ahn.vr

www.villagereach.org

Connect on Facebook****, Twitter** ** and our Blog

That sounds about right to me. One question, for what resources do we want to allow PUT, which is basically putting ? For example don’t think we would want to make it possible to put whole requisition objects.

Also important to note about PUT is that it should be idempotent, so sending the same request multiple times should have the same result.

Regards,

Paweł

···

On 15.09.2016 08:59, Chongsun Ahn wrote:

Hey everyone,

    As we continue to work on designing and implementing REST APIs for the different services, Josh and I would like to propose guidelines for PUT and POST endpoints. I quickly wrote up a document outlining the proposal. It is on the wiki at:

https://openlmis.atlassian.net/wiki/display/OP/OpenLMIS+v3+REST+API+proposed+guidelines+for+POST+and+PUT

Feedback is appreciated.

                Shalom,

                Chongsun

                ​

                -- ​

                There are 10 kinds of people in this world; those who understand binary, and those who don’t.

Chongsun Ahn | chongsun.ahn@villagereach.org

  •                      Software Development Engineer*
    

Village****Reach* ** Starting at the Last Mile*

                    2900 Eastlake Ave. E, Suite 230,  Seattle, WA 98102, USA

DIRECT: 1.206.512.1536 **CELL: ** 1.206.910.0973 FAX: 1.206.860.6972

SKYPE: chongsun.ahn.vr

www.villagereach.org

Connect on Facebook****, Twitter** **and our Blog

  You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

  To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.

  To post to this group, send email to openlmis-dev@googlegroups.com.

  To view this discussion on the web visit [https://groups.google.com/d/msgid/openlmis-dev/E169907E-8C9D-4644-9804-10292DE0DC7F%40villagereach.org](https://groups.google.com/d/msgid/openlmis-dev/E169907E-8C9D-4644-9804-10292DE0DC7F%40villagereach.org?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

Hey Pawel,

I think we would mainly allow PUT for resources that are simple for CRUD, like reference data.

Shalom,

Chongsun

– ​

There are 10 kinds of people in this world; those who understand binary, and those who don’t.

Chongsun Ahn | chongsun.ahn@villagereach.org

Software Development Engineer

Village****Reach* ** Starting at the Last Mile*

2900 Eastlake Ave. E, Suite 230, Seattle, WA 98102, USA

DIRECT: 1.206.512.1536 **CELL: **1.206.910.0973 FAX: 1.206.860.6972

SKYPE: chongsun.ahn.vr

www.villagereach.org

Connect on Facebook****, Twitter** ** and our Blog

···

On 15.09.2016 08:59, Chongsun Ahn wrote:

Hey everyone,

As we continue to work on designing and implementing REST APIs for the different services, Josh and I would like to propose guidelines for PUT and POST endpoints. I quickly wrote up a document outlining the proposal. It is on the wiki at:

https://openlmis.atlassian.net/wiki/display/OP/OpenLMIS+v3+REST+API+proposed+guidelines+for+POST+and+PUT

Feedback is appreciated.

Shalom,

Chongsun

– ​

There are 10 kinds of people in this world; those who understand binary, and those who don’t.

Chongsun Ahn | chongsun.ahn@villagereach.org

Software Development Engineer

Village****Reach* ** Starting at the Last Mile*

2900 Eastlake Ave. E, Suite 230, Seattle, WA 98102, USA

DIRECT: 1.206.512.1536 **CELL: ** 1.206.910.0973 FAX: 1.206.860.6972

SKYPE: chongsun.ahn.vr

www.villagereach.org

Connect on Facebook****, Twitter** ** and our Blog

You received this message because you are subscribed to the Google Groups “OpenLMIS Dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to
openlmis-dev+unsubscribe@googlegroups.com.

To post to this group, send email to
openlmis-dev@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/openlmis-dev/E169907E-8C9D-4644-9804-10292DE0DC7F%40villagereach.org
.

For more options, visit
https://groups.google.com/d/optout
.

This doesn’t sound quite right to me.

In the “resources that have a natural key” scenario, what if you want to edit some of the fields that make up a natural key? E.g. I want to rename a right in the system from “Get Xyz” to “Fetch Xyz”. As you’ve drawn things out, this can’t be done.

-Darius

···

On Thu, Sep 15, 2016 at 9:04 AM, Chongsun Ahn chongsun.ahn@villagereach.org wrote:

Hey Pawel,

I think we would mainly allow PUT for resources that are simple for CRUD, like reference data.

Shalom,

Chongsun

– ​

There are 10 kinds of people in this world; those who understand binary, and those who don’t.

Chongsun Ahn | chongsun.ahn@villagereach.org

Software Development Engineer

Village****Reach* ** Starting at the Last Mile*

2900 Eastlake Ave. E, Suite 230, Seattle, WA 98102, USA

DIRECT: 1.206.512.1536 **CELL: **1.206.910.0973 FAX: 1.206.860.6972

SKYPE: chongsun.ahn.vr

www.villagereach.org

Connect on Facebook****, Twitter** ** and our Blog

On Sep 15, 2016, at 2:33 AM, Paweł Gesek pgesek@soldevelo.com wrote:

That sounds about right to me. One question, for what resources do we want to allow PUT, which is basically putting ? For example don’t think we would want to make it possible to put whole requisition objects.

Also important to note about PUT is that it should be
idempotent, so sending the same request multiple times should have the same result.

Regards,

Paweł

On 15.09.2016 08:59, Chongsun Ahn wrote:

Hey everyone,

As we continue to work on designing and implementing REST APIs for the different services, Josh and I would like to propose guidelines for PUT and POST endpoints. I quickly wrote up a document outlining the proposal. It is on the wiki at:

https://openlmis.atlassian.net/wiki/display/OP/OpenLMIS+v3+REST+API+proposed+guidelines+for+POST+and+PUT

Feedback is appreciated.

Shalom,

Chongsun

– ​

There are 10 kinds of people in this world; those who understand binary, and those who don’t.

Chongsun Ahn | chongsun.ahn@villagereach.org

Software Development Engineer

Village****Reach* ** Starting at the Last Mile*

2900 Eastlake Ave. E, Suite 230, Seattle, WA 98102, USA

DIRECT: 1.206.512.1536 **CELL: **1.206.910.0973
FAX: 1.206.860.6972

SKYPE: chongsun.ahn.vr

www.villagereach.org

Connect on Facebook****, Twitter** ** and our Blog

You received this message because you are subscribed to the Google Groups “OpenLMIS Dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to
openlmis-dev+unsubscribe@googlegroups.com.

To post to this group, send email to
openlmis-dev@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/openlmis-dev/E169907E-8C9D-4644-9804-10292DE0DC7F%40villagereach.org
.

For more options, visit
https://groups.google.com/d/optout
.

You received this message because you are subscribed to the Google Groups “OpenLMIS Dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.

To post to this group, send email to
openlmis-dev@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/openlmis-dev/9da74319-43d9-5a65-3db8-70226a065cbe%40soldevelo.com
.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “OpenLMIS Dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.

To post to this group, send email to openlmis-dev@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/7D11A464-C313-456A-AAA3-3168B55A9550%40villagereach.org.

For more options, visit https://groups.google.com/d/optout.

Darius JazayeriPrincipal Architect - Global Health
Email
djazayeri@thoughtworks.com

Telephone
+1 617 383 9369

ThoughtWorks