Skip to content

Instantly share code, notes, and snippets.

@lukaszkorecki
Last active September 27, 2016 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszkorecki/811e6a788f2e0a4e370e428d579036ca to your computer and use it in GitHub Desktop.
Save lukaszkorecki/811e6a788f2e0a4e370e428d579036ca to your computer and use it in GitHub Desktop.
import requests
import json
auth = 'Token <your token>'
payload = [
{
'source': "L. Ritchie",
'content': [
{
'body': "hello? Is this me you're looking for?",
},
],
},
]
response = requests.post('https://api.nomnom.it/v1/documents/import',
data=json.dumps(payload),
headers={'Authorization': auth,
'Content-Type' : 'application/json'})
print response.json()
# => [{u'errors': [], u'id': u'f6ecb320-a28c-4252-8512-e739a27f6680'}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment