I am trying to create a new group using Python, my code is the following. But I keep receiving error. I could be wrong but I assume it has something to do with the User-Agent in the header (which is missing here since I do not know the User-Agent of the Purple Air End). Does anyone know what to do with it?
My Python Code:
import requests
my_headers = {‘Content-Type’:‘application/json’,
‘X-API-Key’ : ‘***** my WRITE api-key *******’}
in_values = {‘name’:‘Alaska’}
url=‘https://api.purpleair.com/v1/groups’
response = requests.post(url, headers=my_headers, data=in_values)
print(response.text)
The Error Information: