Skip to content

A REST DELETE call fails with 'ETag must have a valid value' even after copying the ETag value from a prior GET response's @odata.etag field into the If-Match header exactly as returned.

Answer

The @odata.etag value as shown in a GET response is JSON-escaped — it contains backslash-escaped quote characters (\") that need to be JSON-unescaped before use, not passed through literally. Strip the backslash characters out so the quotes inside the ETag value become plain, unescaped double quotes, and use that cleaned-up string as the If-Match header value — using the raw, still-escaped string from the JSON response body directly in the header is what causes the 'ETag must have a valid value' error.

← Browse Integrations and APIs questions