Hankintailmoitukset / hilma-api

12 stars 0 forks source link

What is a difference between codes 201 and 200 returned from /eforms/external-write/v1/eform/can #147

Closed eduardsmirnov closed 1 year ago

eduardsmirnov commented 1 year ago

What is the difference between codes 201 and 200 returned from /eforms/external-write/v1/eform/can Which one means the notice is submitted? Should I expect "hilmaNotice" to contain your notice id and "esentoolNotice" to be TED notice id? Do I need to verify the content of "esentoolValidationReport" or it is enough to trust the response code 201 ?

Havunen commented 1 year ago

HTTP 201 means a new entry was created https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201 in this case a new notice HTTP 200 means the request executed successfully in this case an existing notice was updated

The request body notice content

<cbc:ID schemeName="notice-id">guid</cbc:ID>

is used to identify the notice

Havunen commented 1 year ago

Do I need to verify the content of "esentoolValidationReport" or it is enough to trust the response code 201 ?

We haven't yet finalized the API implementation and are not sure how it will be in the final version.

The initial plan is to validate the notice immediately and then fail the request if it does not pass the TED validations.