문제

How do you delete / update a metadata object through the API?

For example Scheduled emails: http://docs.gooddata.apiary.io/#reportsanddashboardsbyemail In the documentation I see how to create a new one or get existing ones. How do I delete a Scheduled email?

DELETE https://secure.gooddata.com/gdc/md/PROJECT_ID/obj/OBJECT_ID

For scheduledMail it works fine, but does it work universally?

How do you update a scheduled email? Does PUT work? What request body should I use? Or do I have to delete the old object and create a new one?

도움이 되었습니까?

해결책

For each metadata object the DELETE works. For updating the object use the PUT where the body will be response to the same resource from GET request that you can easily edit and send back using PUT to the same resource. So the workflow will be:

  1. GET metadata object
  2. Update the object body (JSON)
  3. PUT it back on the same resource from which you got it

This works for all metadata objects. You can easily recognised those objects by

/obj/OBJECT-ID

Thanks for the question!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top