I'm trying to make batched requests more efficient by getting partial responses. I'm interested to get just certain headers (from, to, subject) and the message body.
As you can see in the above request, I'm getting ALL the header name, value pairs as payload(headers(name,value). But when I change the code to select only certain headers (I'm interested only in From, To, Subject).
Invalid FieldMask 'id,snippet,payload(headers(name,value)[name=From,To,Subject],body,parts)'. Map keys should be represented as ["some_key"].
I tried changing it to headers(name,value)[name="From",name="To",name="Subject"] and a few other formats but cannot figure out how to get it right. The API documentation too doesn't go in-depth to discuss how to select specific headers in key-value pairs so some help would be appreciated. Thanks.
As far as i know you cant map on keys like that use this I have never heard of it and cant really find anything in the docs about it. Would be awesome if it did work though.
This works:
id,snippet,payload(headers,body,parts)
you should use the Try me on this page if you want to test it out though.
I'm trying to make batched requests more efficient by getting partial responses. I'm interested to get just certain headers (from, to, subject) and the message body.
My code works fine when I run it like this:
As you can see in the above request, I'm getting ALL the header name, value pairs as
payload(headers(name,value)
. But when I change the code to select only certain headers (I'm interested only in From, To, Subject).The API throws me an error:
I tried changing it to
headers(name,value)[name="From",name="To",name="Subject"]
and a few other formats but cannot figure out how to get it right. The API documentation too doesn't go in-depth to discuss how to select specific headers in key-value pairs so some help would be appreciated. Thanks.