1

This Google Analytics API call https://developers.google.com/apis-explorer/#search/analytics/analytics/v3/analytics.management.uploads.deleteUploadData returns 204 without message body. At least it returns some headers:

cache-control:  no-cache, no-store, max-age=0, must-revalidate
date:  Tue, 08 Aug 2017 12:44:42 GMT
etag:  "sP5LBgqDii7ksJERAgMB0CpTbRM/vyGp6PvFo4RvsFtPoIWeCReyIC8"
expires:  Mon, 01 Jan 1990 00:00:00 GMT
pragma:  no-cache
server:  GSE
vary:  Origin, X-Origin

Same behaviour with googleapis@17.1.0 node module.

Edit: As mentioned by m90, this should indicate that the server has fulfilled the request but in my Analytics account no upload items are beeing deleted.

user1706507
  • 101
  • 2
  • 8
  • 204 is the standard response when deleting something - the resource does not exist anymore when the request was successful, hence `No content`. – m90 Aug 08 '17 at 13:16
  • But there isn't anything deleted. The IDs I send are correct, otherwise I would get _Invalid argument: Import Record does not exist_ – user1706507 Aug 08 '17 at 13:23
  • I'm pretty sure there are things being deleted, the example you linked to says `Custom data source Id for the uploads to be deleted. (string)`. The IDs sure are correct, but that doesn't mean they can't be deleted. – m90 Aug 08 '17 at 13:26
  • Seems that upload order is relevant. It only works if the latest uploaded items are deleted first. If the IDs (`customDataImportUids`) are correct, it returns 204 in any case. But it only deletes them if the deletion order is correct. So there is no way to handle wrong deletion order. – user1706507 Aug 08 '17 at 14:37

1 Answers1

3

204 status code translates to "No Content"

The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation. The response MAY include new or updated metainformation in the form of entity-headers, which if present SHOULD be associated with the requested variant.

In RESTful services it is a common pattern to respond with 204 and an empty body upon deletion of an entity, just like the call you are describing (quoting Custom data source Id for the uploads to be deleted. (string)). This question: REST API error return good practices has good info on how to read status codes from RESTful services.

m90
  • 11,434
  • 13
  • 62
  • 112