Hi,
I took this from Atlassian documentation.
I got 401 Response. anyone know why?
import requests
from requests.auth import HTTPBasicAuth
import json
customers_id = "10163"
contextId = "int64"
auth = HTTPBasicAuth("MY_EMAIL", "MY_API_TOKEN")
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
payload = json.dumps( {
"options": [
{
"disabled": "false",
"value": "Scranton"
},
{
"optionId": "10000",
"disabled": "true",
"value": "Manhattan"
},
{
"disabled": "false",
"value": "The Electric City"
}
]
} )
response = requests.request(
"POST",
url,
data=payload,
headers=headers,
auth=auth
)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))