Android Question How do you pass an oAuth2 token with HTTPJob.PutString ?

antsnel

Member
Licensed User
Longtime User
Hi Erel,

Thanks for the reply I can download data from a Google Sheet using your oAuth2 example,

I am now trying to update the same spreadsheet - it also seems I should use PostString and not PutString as per my previous attempt.

API call is documented here:

https://developers.google.com/sheets/api/guides/values#writing_to_a_single_range

Assuming my token is valid and stored in a variable called token,

I need to know how to append the token to this API call when doing a Post or Put (I am also assuming this specific API endpoint supports it)

Thanks
 
Upvote 0

antsnel

Member
Licensed User
Longtime User
Thanks - I passed the token successfully as a query string , however I found you'll also need to tell the Google Sheets API that your submitted data is json:

B4X:
j.GetRequest.SetContentType("application/json")
 
Upvote 0
Top