If you don’t have access to your user’s contacts yet, you can still get into using YesGraph by looking at data from your own users. YesGraph allows you to submit data about your users in bulk. We use this data to generate better ranking results for your users.

POST /users

Hit this endpoint when you want to submit your user’s information to YesGraph to let us analyze your users and return enriched results.

# Use YesGraph's Python SDK 
# https://github.com/yesgraph/python-yesgraph
from yesgraph import YesGraphAPI
api = YesGraphAPI("YOUR_SECRET_KEY")
users = [
  {
    "username": "nvie",
    "name": "Vincent Driessen",
    "email": "me@nvie.com"
  },
  {
    "id": "1234",
    "email": "ivan@kirigin.com"
  },
  {
    "username": "myhorseapp",
    "name": "Jonathan Chu",
    "email": "jonathan.chu@me.com"
  }
]
api.post_users(users)
###

{
  "message": "Bulk of 3 users stored for test.",
  "meta": {
    "time": 0.08466883659362793,
    "docs": "https://www.yesgraph.com/docs/#post-users"
  }
}
curl -X POST \
    -H 'Authorization: Bearer YOUR_SECRET_KEY' \
    -H 'Content-Type: application/json' \
    -d '[
  {
    "username": "nvie",
    "name": "Vincent Driessen",
    "email": "me@nvie.com"
  },
  {
    "id": "1234",
    "email": "ivan@kirigin.com"
  },
  {
    "username": "myhorseapp",
    "name": "Jonathan Chu",
    "email": "jonathan.chu@me.com"
  }
]' \
    https://api.yesgraph.com/v0/users
###

{
  "message": "Bulk of 3 users stored for test.",
  "meta": {
    "time": 0.08466883659362793,
    "docs": "https://www.yesgraph.com/docs/#post-users"
  }
}

User Attributes

Every User document may specify the following fields. These fields are standardized based on common naming conventions used in software. Please try to send your data using these conventional fields.

id required unless username is present Your internal user ID, if applicable
username required unless id is present Your internal username, if applicable
name optional The user’s full name
first_name optional The user’s first name
last_name optional The user’s last name
email optional The user’s email address
phone optional The user’s phone number
location optional The user’s location
picture optional The URL to the user’s profile picture
url optional The URL to the user’s account or profile
* optional, object Any other attributes you wish to store with this user

Attribute Aliases

For your convenience, we’ve aliased the following attribute names, so they will be automatically detected.

If you send… …we’ll store it as
city location
family_name, familyName last_name
fullname, fullName name
given_name, givenName first_name
image, image_url, imageUrl, picture_url, pictureUrl picture
link url
pk id
telephone phone

Extra Attributes

If you have more data you want to record on your user record, you can just add those attributes, and they will remain stored with your user data. For example, your custom fields could include last_login, subscription, or last_purchase data. Include whatever makes sense for your app.