question

MichGijs-7002 avatar image
0 Votes"
MichGijs-7002 asked MichGijs-7002 answered

Daily insights with Bing Ads script to Google Spreadsheet

Hello,

I've used the example of https://gist.github.com/krsoninikhil/30f5b0339c3c7f35645dff1713674473 to make the script.
As I don't want to manually refresh the token every hour (since the script should run automatically every night), I used option 3 in https://docs.microsoft.com/en-us/advertising/scripts/examples/authenticating-with-google-services#option3 to get a refresh token using a PowerShell script.

I then followed the example to leave accessToken empty (https://docs.microsoft.com/en-us/advertising/scripts/examples/calling-google-services) and filled in the rest as supposed to

const credentials = {
accessToken: '',
clientId: 'myid',
clientSecret: 'my-secret',
refreshToken: 'refreshtoken-i-got-via-powershell'

Since I did that I get this message:
"error": "invalid_grant",
"error_description": "Bad Request""

I've no idea what to do, can somebody help with this? Thanks in advance

advertising-api
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichGijs-7002 avatar image
0 Votes"
MichGijs-7002 answered

Coming back to my question. It doesn't have to be connected to Google Spreadsheet. If I can just write it to a CSV, that would be great. Still stuck on what to do.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.