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.
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://video2.skills-academy.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://video2.skills-academy.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