Hello team, I have a question about the API for en...
# gd-beginners
j
Hello team, I have a question about the API for entity (for example, notificationChannel) management: it seems that POSTs are strictly for creates and PUTs for updates. Is there a way to do an upsert (update if exists, create otherwise)?
j
Hi Jonas, GoodData APIs follow standard REST conventions.
POST
is for creating new entities, and
PUT
is for updating existing ones. There’s no built-in “upsert” operation, so you’ll need to implement it manually: check if the entity exists with a
GET
, then
POST
or
PUT
as appropriate.
j
Thanks for the response. I thought that there might be "upsert" support given that the API allows a client to specify the Id of the entity,