The YesGraph Developer Hub

Welcome to the YesGraph developer hub. You'll find comprehensive guides and documentation to help you start working with YesGraph as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Python SDK

Available through pip:

pip install --upgrade yesgraph

Find the source on GitHub and you can find the YesGraph package on PyPI.

Below are examples of using the API

Setup

Here's how you would set your API key and make a test call using python-yesgraph:

from yesgraph import YesGraphAPI
api = YesGraphAPI('YOUR_SECRET_KEY')
print(api.test())
###
{'message': 'You have successfully made an authorized request to the '
            'YesGraph API!',
 'meta': {'app_name': 'test',
          'docs': 'https://www.yesgraph.com/docs/#get-test',
          'env': 'live',
          'help': 'Please contact support@yesgraph.com for any issues.',
          'user_id': None}}

POST Address Book

Assuming that your secret key is still set from the above example, here's how you would make a POST call to send address book entries:

# Building the address book entries dictionary first
entries = [
  {"name": "Ivan Kirigin", "email": "ivan@yesgraph.com"},
  {"name": "Vincent Driessen", "email": "vincent@yesgraph.com"},
  {"name": "George Hickman", "email": "george@yesgraph.com"}
]
response = api.post_address_book(user_id=1234,
                                 entries=entries,
                                 source_name='Jonathan Chu',
                                 source_email='jonathan@yesgraph.com',
                                 source_type='gmail')
print(response)
{'batch_id': '3d958e33-9734-4095-8bfc-e95f13db86a5',
 'message': 'Address book for 3 added.'}

POST Invite Sent

Here's how you would make a POST call to send an invite-sent document. Let's say you sent an invite to "john@smith.com" and would like to send over that data to the YesGraph API.

response = api.post_invite_sent(user_id=1234,
                                invitee_id='john@smith.com',
                                invitee_type='email')
print(response)
{'message': 'Invite sent added.',
 'meta': {'docs': 'https://www.yesgraph.com/docs/#post-invite-sent',
          'help': 'Please contact support@yesgraph.com for any issues.',
          'time': 0.0181579351425171}}

POST Invite Accepted

And finally, if John Smith (from the above example) accepts your invite, here's how you can send us that data:

response = api.post_invite_accepted(invitee_id='john@smith.com',
                                        invitee_type='email')
print(response)
{'message': 'Invite accepted added.',
 'meta': {'docs': 'https://www.yesgraph.com/docs/#post-invite-accepted',
          'help': 'Please contact support@yesgraph.com for any issues.',
          'time': 0.020092248916625977}}

Python SDK