User Object

The user object contains information about a specific HipGeo user. The rights of the authenticated user are evaluated to determine what information they are allowed to view and only that information is returned. Public information is always available to all users.

Objects can be referenced using either the USERID string specified in the data returned by the API or using "me" which references the authenticated user.

User objects support the GET , PUT, and DELETE methods as indicated in the examples below. You must be the authenticated user to PUT or DELETE a user.

Definition of proprietary parameters in the user object:

  • allow_auto_pinpoint:
    • 1 = enable auto pinpoint
    • 0 = disable auto pinpoint
  • apns_types:
    • currently unused
  • global privacy: Determines initial privacy setting of new journal entries created, default = 7
    • 0 = everyone
    • 3 = private
    • 7 = friends
  • view_friends:
    • 0 = everyone
    • 3 = private
    • 7 = friends
  • Control delivery of push alerts. Alerts currently supported are:
    • comment_delivery
    • follow_delivery
    • like_delivery
    • news_delivery
    The selectable delivery method for each alert are:
    • 0x00 – no message delivery
    • 0x01 – email only
    • 0x10 – app push only
    • 0x11 – email and app (default)
  • Facebook parameters:
    • fb_graph = 1, will cause follow, like, comment events to be sent to facebook
    • fb_visit = 1, will cause visit events to be sent to facebook.
  • Android mobile device C2DM (Cloud to Device Messaging) auth token
    • c2dm_token = "valueoftoken", Auth token is obtained from Google
  • options
    • Options data is any valid JSON structure
    • PUT is global i.e. each PUT overwrites ALL of the options.

Example1: /me - user object

GET http://api.hipgeo.com/me?access_token=TOKENVALUE

Returns:
{
  "user":{
    "id":"u_777",
    "name":"Jonathan",
    "shareable":1,
    "pingable":1,
    "url":"http:\/\/www.hipgeo.com\/Gerard",
    "fullname":"Jonathan Swiift",
    "avatar":{
      "id":"m_11101",
      "shareable":0,
      "type":0,
      "when":"2012-01-06 22:42:29",
      "icon":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0aa8fb58_m?11101",
      "icon_l":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0aa8fb58_l?11101",
      "icon_b":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0aa8fb58_b?11101",
      "full":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0aa8fb58_d?11101",
      "height":494,
      "width":662
    },
    "photo":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0aa8fb58_m?11101",
    "position":{
      "when":"2012-03-09 00:19:00",
      "coord":{
        "lat":33.556025,
        "lon":-117.555843
      },
      "title":"Traveled within Diamond Bar, CA",
      "id":"t_133671"
    },
    "about":"TESTER TESTER TESTER",
    "firstname":"Jonathan",
    "lastname":"Swift",
    "email":"jonathanswift@fantasy.com",
    "apns_token":"a3cbc326a497c314a4067ded06bb5b651cc9d8fa3452483bf0cf92c3a9f17ae9",
    "apns_types":7,
    "c2dm_token":"0",
    "view_friends":7,
    "global_privacy":7,
    "allow_auto_pinpoint":1,
    "fb_visit":0,
    "fb_graph":1,
    "comment_delivery":17,
    "like_delivery":0,
    "news_delivery":1,
    "follow_delivery":0,
    "tzn":"America\/Los_Angeles",
    "tzo":-25200,
    "distance_unit":2,
    "debug":1,
    "options":{
       "fred":1,
       "bill":3
    },
    "stats":{
      "locations":2171,
      "travels":2181,
      "distance":129228934.08,
      "photos":1093,
      "journal_likes":"75",
      "following":41,
      "followers":28
    }
  },
  "result":"success",
  "st":1332350191
} 
Error Code Possible Errors
401
  1. Authentication failed
  2. Token expired
  3. Insufficient Permission
  4. 'me' requires authentication
404
  1. ID not found
  2. Bad ID

Example2: /USERID - user object

GET http://api.hipgeo.com/u_555

Returns:
{
  "user":{
    "id":"u_555",
    "name":"joe",
    "shareable":1,
    "pingable":1,
    "url":"http:\/\/www.hipgeo.com\/joe",
    "fullname":"Joe Boxer",
    "avatar":{
      "id":"m_2519",
      "shareable":0,
      "type":0,
      "when":"2011-06-29 21:38:52",
      "icon":"http:\/\/img.hipgeo.com\/410eac7f08b1ca5b4739bb4f8c61d3_m?2519",
      "icon_l":"http:\/\/img.hipgeo.com\/410eac7f08b1ca5b4739bb4f8c61d3_l?2519",
      "icon_b":"http:\/\/img.hipgeo.com\/410eac7f08b1ca5b4739bb4f8c61d3_b?2519",
      "full":"http:\/\/img.hipgeo.com\/410eac7f08b1ca5b4739bb4f8c61d3_d?2519",
      "height":662,
      "width":662
    },
    "photo":"http:\/\/img.hipgeo.com\/410eac7f08b1ca5b4739bb4f8c61d3_m?2519",
    "position":{
      "when":"2012-03-09 07:53:55",
      "coord":{
        "lat":33.88436,
        "lon":-117.9963
      },
      "title":"Private Place in Pasadena, CA",
      "id":"l_1337157"
    },
    "friend":1,
    "follower":1,
    "following":1,
    "firstname":"Joe",
    "lastname":"Boxer",
    "stats":{
      "locations":2450,
      "travels":2448,
      "distance":125411126.59,
      "photos":1852,
      "journal_likes":"326",
      "following":216,
      "followers":117
    }
  },
  "result":"success",
  "st":1332351808
} 
Error Code Possible Errors
404
  1. ID not found
  2. Bad ID

PUT (or POST)

After registration, the user PUT endpoint can be used to update user data. The attributes that can be updated are:

  1. firstname
  2. lastname
  3. username
  4. apns_token
  5. apns_types
  6. global_privacy
  7. view_friends
  8. password
  9. original_password
  10. allow_auto_pinpoint
  11. tzn
  12. facebook data (OAuth verifier is not stored in DB)
  13. twitter data
  14. comment_delivery
  15. follow_delivery
  16. like_delivery
  17. news_delivery
  18. fb_visit
  19. fb_graph
  20. c2dm_token
  21. options

Method Description
/me update auth user data. See Example3 for JSON data structure

Example3: me - update auth user data

PUT api.hipgeo.com/me?access_token=TOKENVALUE

Data:
{
   "firstname":"John",
   "lastname":"Doe",
   "email":"john@doe.com",
   "username":"jon",
   "apns_token":"a3cbc326a497c314a4067ded06bb5b6c9d8fa3452483bf0cf92c3a9f17ae9",
   "apns_types":5,
   "view_friends":0,
   "global_privacy":7,
   "password":"nowayjose",
   "original_password":"nowayjose",
   "allow_auto_pinpoint":0,
   "tzn":"Asia/Jerusalem",
   "facebook":{
      "page_id":"100000844496018",
      "access_token":"6Pg0PsqUeLH2F--TRUNCATED--Q3U1fWLIRL4Jk35mWUsgJ4t5E0"
   },
   "twitter":{
      "oauth_token_secret":"oL8SbthCEqZyDTZTJBo9pdjDAwBMGGiy4MUfeGlAI",
      "oauth_verifier":"6581540",
      "user_id":"333225519",
      "screen_name":"pkg172",
      "oauth_token":"333225519-WxjyA2SMqNH9NZLbfvQl6b4SWVIrGvlrw5XzW54F"
   },
   "options":{
      "fred":1,
      "bill":3
   },
   "like_delivery":0,
   "news_delivery":1,
   "follow_delivery":16,
   "comment_delivery":17,
   "fb_visit":1,
   "fb_graph":0,
   "c2dm_token":"valueoftoken"
}

Returns:
{
  "id":"u_215",
  "result":"success"
} 
Error Code Possible Errors
400
  1. Invalid request
  2. Authentication failed
  3. Unable to parse data
  4. Invalid api key
  5. email - Email address is required
  6. email - Not a valid email address
  7. email - anything@hipgeo.com is invalid
  8. email - Email is too long
  9. email - This email is already used
  10. username - Sorry, this user name is taken
  11. username - HipGeo is not allowed in names
  12. username - Spaces are not allowed in names
  13. username - Only letters and numbers
  14. username - Must contain a letter
  15. password - Password is required
  16. password - Must be at least 6 characters
  17. password - Password cannot be over 20 characters
  18. password - Only letters, numbers and !@#$%^&*-_
  19. firstname - Only letters are allowed
  20. lastname - Only letters are allowed
  21. Invalid global privacy setting
  22. Invalid view friends privacy setting
  23. Invalid value for allow_auto_install [aai value]
  24. Invalid value for allow _auto_pinpoint [aap value]
  25. tzn - Invalid time zone specification [xxx/yyy]
  26. tzo - Must have valid time zone or offset [xxx/yyy]
  27. tzn/tzo - Time zone information is required
  28. Invalid value for comment_delivery
  29. Invalid value for follow_delivery
  30. Invalid value for like_delivery
  31. Invalid value for news_delivery
401
  1. Original password is invalid

Delete User Object Example

User delete requires an additional parameter (full=1). The "full" delete removes the user and all data associated with that user including comments, glls, media, and journal entries. A user delete that leaves some data or allows restore may be supported in the future.

DELETE http://api.hipgeo.com/u_1442?full=1&SHA1PASSWORD&access_token=TOKENVALUE

Returns:
{
  "id":"u_1442",
  "result":"success",
  "st":1332354265
} 
Error Code Possible Errors
400
  1. Requires an ID - missing objectId
  2. Valid password required for delete
  3. Only full delete supported - full =1 required
401
  1. Authentication failed
  2. Token expired
  3. Insufficient Permissions

Help Categories

HipGeo Icon