{"_id":"5d7259bd5e2f260262060f97","project":"569f7ef06c5c930d007e22bd","initVersion":{"_id":"595ba3bb9ec1a2001512ab8f","version":"2"},"user":{"_id":"5ba9ee7c64b8c60003f1d903","username":"","name":"Andrés Barriga"},"hidden":false,"type":"","__v":0,"metadata":{"title":"","description":"","image":[]},"createdAt":"2019-09-06T13:06:05.103Z","changelog":[],"body":"We recently had an issue when using a \"gtag/:id\" endpoint in an event looking for an id that by chance had also the same :uid. By (bad) design we have added the gtag id and gtag uid under the same endpoint. \nDespite this issue happened only once in 4 years, we have made these changes to fix anti rest endpoint in order to avoid gtag/ticket/customers updates to not desired objects and the  consistency of these data.\n\nEndpoints incorrenctly designed changed:\ngtags/:id on GET and PATCH was accepting before tag_uid as id. Now only accepts id\ntickets/:id on GET and PATCH was accepting before code as id. Now only accepts id\ncustomers/:id on GET and PATCH was accepting before email as id. Now only accepts id\n\nNow to be able to search by other fields we have created 3 new endpoints:\nhttps://api.glownet.com/reference#customerssearch\nhttps://api.glownet.com/reference#ticketssearch\nhttps://api.glownet.com/reference#gtagssearch\n\nIf you was updating (PATCH) objects by tag_uid, code or email you have to do a search request before to take the object id and execute the update with the object id as rest require.","slug":"new-search-endpoints","title":"API V2 Data Consistency Changes"}

API V2 Data Consistency Changes


We recently had an issue when using a "gtag/:id" endpoint in an event looking for an id that by chance had also the same :uid. By (bad) design we have added the gtag id and gtag uid under the same endpoint. Despite this issue happened only once in 4 years, we have made these changes to fix anti rest endpoint in order to avoid gtag/ticket/customers updates to not desired objects and the consistency of these data. Endpoints incorrenctly designed changed: gtags/:id on GET and PATCH was accepting before tag_uid as id. Now only accepts id tickets/:id on GET and PATCH was accepting before code as id. Now only accepts id customers/:id on GET and PATCH was accepting before email as id. Now only accepts id Now to be able to search by other fields we have created 3 new endpoints: https://api.glownet.com/reference#customerssearch https://api.glownet.com/reference#ticketssearch https://api.glownet.com/reference#gtagssearch If you was updating (PATCH) objects by tag_uid, code or email you have to do a search request before to take the object id and execute the update with the object id as rest require.