swisspost / myit-api-doc

Documentation for the Incident API of MyIT.
https://swisspost.github.io/myit-api-doc/incidentRestAPI.html
0 stars 0 forks source link

Fetch Incident returns internal Error when invalid partnerIncidentId is provided #5

Closed vollraths closed 1 month ago

vollraths commented 2 months ago

Try to check whether a partnerIncidentId exists or is still valid (assuming Tickets will eventually be purged). If a so far not used partnerIncidentId is provided the API doesn't return "not found" but throws a internal error. GET https://myit-dev.post.ch/api/x_ssagd_inc_rest/rest/incident?partnerId=commvault&partnerIncidentId=a9328944-1ea0-31e2-a161-4b5983aa7dbe { "message": "An internal error has occurred and has been logged with errorKey '84b2b0d287afc6143efcec230cbb3595'. Please contact the MyIT team." }

vollraths commented 2 months ago

PS: would look it up on the data-api but that has no documentation of available parameters (that i know of) and doesn't seem to expose the partnerIncidentId as a searchable parameter nor list it as a data-attribute in the resultset.

timschaeren commented 2 months ago

Makes complete sense - I'll build better error handling for that today. I'll keep you posted.

timschaeren commented 2 months ago

Sorry, this took longer than expected. Please go ahead and retry your request. There now should be complete handling of any non-ok cases with partnerIncidentId, including useful error messages for nonexistent or non-unique id's.

vollraths commented 2 months ago

similarly sorry for the late reply. can work with the 404 for now, may add further pattern matching to the response-text later. is it just me or did the reply previously contain the "incidentId" as well as the "sys_id" with same value? somehow hadthe latter in my checks, so sorry for the many incorrect 409 collisions creating tickets the last days.

timschaeren commented 1 month ago

Correct - 'sys_id' (internal value) is now translated to 'incidentId' ('client-facing value).