Fetching message as Raw

74 views
Skip to first unread message

MP

unread,
Apr 20, 2019, 9:07:15 AM4/20/19
to Google APIs Client Library for Objective-C
Hello, 

I am trying to get message using API as raw but it's not working - I am setting as " getQuery.format = kGTLRGmailFormatRaw;" and in response I am getting below error - 

Error Domain=com.google.GTLRErrorObjectDomain Code=400 "Invalid string value: 'raw'. Allowed values: [full, metadata, minimal]" UserInfo={GTLRStructuredError=GTLRErrorObject 0x600000c8ba80: {code:400 errors:[1] message:"Invalid string value: 'raw'. Allowed values: [full, metadata, minimal]"},


Does this mean objective c rest does not support fetching as raw ?


Thanks.

Thomas Van Lenten

unread,
Apr 23, 2019, 11:13:14 AM4/23/19
to Google APIs Client Library for Objective-C
The message would be coming from the server, not the client library.  You'll likely want to use some of the support means that api documents (https://developers.google.com/gmail/api/support) to try and get help.  The library has support for logging the HTTP traffic so you can include a snippet of the request going over the wire and the response it is sending back.

TVL

MP

unread,
Apr 23, 2019, 12:57:16 PM4/23/19
to Google APIs Client Library for Objective-C
Thomas, Thanks for the reply and update. Yes error is from server but I checked and was able to get the raw email via browser (using API explorer - https://developers.google.com/gmail/api/v1/reference/users/messages/get) so I don't think it is a server issue. Or may be if server is banning based on user-agent etc. Do you still need HTTP traffic? Let me know.

Thomas Van Lenten

unread,
Apr 23, 2019, 1:42:40 PM4/23/19
to Google APIs Client Library for Objective-C
Again, the reply comes from the server, it is a server issue; the client never generates errors like that on its own; you'll need to ask on their support areas.  The docs for the server api might also provide more details, raw access might require different scopes, or something else that your client test vis api explorer usage are differing in.

TVL
Reply all
Reply to author
Forward
0 new messages