Skip to content

Instantly share code, notes, and snippets.

@alecrajeev
Forked from dancaps/add_account_v3.py
Last active January 23, 2018 03:29
Show Gist options
  • Save alecrajeev/c39ea1db8a47b338349023e8c4ed59ae to your computer and use it in GitHub Desktop.
Save alecrajeev/c39ea1db8a47b338349023e8c4ed59ae to your computer and use it in GitHub Desktop.
Why is this not working?
import requests
import json
# add the Admin API access key where it says access key in the headers value
cc_api_url = 'https://api.cloudcheckr.com/api/account.json/add_account_v3'
headers = {'Content-Type': 'application/json', 'access_key': ''}
params = {'account_name': 'test_account'}
r = requests.post(cc_api_url, headers=headers, data=json.dumps(params))
print r.json()
@alecrajeev
Copy link
Author

CloudCheckr requires the data to be json format, hence the json.dumps()

@dancaps
Copy link

dancaps commented Jan 23, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment