I am trying to run the following code for googleautoreply but it is giving the error 'Invalid JSON payload received.

Here is the Code:

 import requests

 import json

 data = {"comment":"Thank you"}

 headers = 
 {
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) 
   AppleWebKit/537.36 "    "(KHTML, like Gecko) Chrome/94.0.4606.81 
    Safari/537.36 Edg/94.0.992.50",

    "Authorization": "Bearer {token},
 } endpoint="https://mybusiness.googleapis.com/v4/accounts/{accounts_id}/locations/{location_id}/reviews/{reply_id}/reply"

 var=requests.put(endpoint, data=data, headers=headers).json()

 print(var)
1

There are 1 answers

0
Manish Saini On

After doing research I got to know that we have to pass the data in this way

 data = """{"comment":"Thank you"}"""