Skip to content

Instantly share code, notes, and snippets.

@piotrplaneta
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save piotrplaneta/9394667 to your computer and use it in GitHub Desktop.

Select an option

Save piotrplaneta/9394667 to your computer and use it in GitHub Desktop.
First request (you can also call for xml format, like described in docs):
curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://sales.futuresimple.com/api/v1/authentication.json -d'{"email": "MY_EMAIL", "password": "MY_PASSWORD"}'
Response:
{"authentication":{"token":"MY_TOKEN"}}
Now i put this token in my headers like this (to get contacts, also you can specify for xml, like in docs):
curl -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Pipejump-Auth: MY_TOKEN" -H "X-Futuresimple-Token: MY_TOKEN" -X GET https://sales.futuresimple.com/api/v1/contacts.json
I receive json representation of contacts list
Now when i want to gor example create a new contact i do this (also possibility in xml, like in docs):
curl -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Pipejump-Auth: MY_TOKEN" -H "X-Futuresimple-Token: MY_TOKEN" -X POST https://sales.futuresd'{"contact": {"first_name": "Piotr", "last_name": "Planeta"}}'
Response (newly created contact):
{"contact":{"id":54097182,"account_id":246862,"user_id":294122,"created_at":"2014-03-06T17:14:04Z","updated_at":"2014-03-06T17:14:04Z","address":null,"city":null,"contact_id":null,"country":null,"creator_id":294122,"description":null,"email":null,"facebook":null,"fax":null,"industry":null,"is_organisation":false,"linkedin":null,"mobile":null,"name":"Piotr Planeta","phone":null,"private":false,"region":null,"skype":null,"title":null,"twitter":null,"website":null,"zip":null,"first_name":"Piotr","last_name":"Planeta","is_sales_account":false,"linkedin_display":null,"custom_fields":{},"tags_joined_by_comma":"","organisation_name":null,"organisation":null,"sales_account":null,"root_entity_id":54097182,"root_entity_name":"Piotr Planeta"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment