API Endpoints

share

The share endpoint allows a user to share his public and private data. The share endpoint will return a link to a user's myday feed or an object owned by the user. Exceptions are the public user objects which can be shared without ownership. Objects supported are:

  • journal - JOURNALID
  • location - LOCATIONID
  • media - MEDIAID
  • place - PLACEID
  • travel - TRAVELID
  • user - USERID

Method Description
/me/myday/share return link to user's myday
/OBJECTID/share return link to a valid object. owned by the user

Example1: me/myday/share

PUT http://api.hipgeo.com/me/myday/share?access_token=TOKENVALUE

Returns:
{
  "key":"zlpvoo",
  "id":"me.myday",
  "url":"hipgeo.com\/r\/zlpvoo",
  "result":"success"
}  
Error Code Possible Errors
3
  1. Invalid date or time string [xxxx]
400
  1. Requires an ID
  2. Target is not a valid object
401
  1. Authentication failed
  2. Token expired
  3. 'me' requires authentication
  4. Insufficient permissions
403
  1. Authorization required
404
  1. Bad ID
405
  1. Not User ID
  2. You cannot view this user's day

Example2: /OBJECTID/share - share link


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

Returns:
{
  "key":"dfaer7",
  "id":"l_25470",
  "url":"hipgeo.com\/r\/dfaer7",
  "result":"success"
} 
Error Code Possible Errors
400
  1. Requires an ID
  2. Target is not a valid object
401
  1. Authentication failed
  2. Token expired
  3. Insufficient permissions
403
  1. Authorization required
404
  1. Bad ID

Example3: /USERID/share - user share link

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

Returns:
{
  "url":"hipgeo.com\/johnny",
  "id":"u_2077",
  "result":"success"
} 
Error Code Possible Errors
400
  1. Requires an ID
  2. Target is not a valid object
401
  1. Authentication failed
  2. Token expired
  3. Insufficient permissions
403
  1. Authorization required
404
  1. Bad ID

POST

The POST share endpoint lets the user add a Title and/or Description for the object being shared, and also the ability to add Delivery methods for the share link. Delivery methods supported are:

  • email
  • sms
  • facebook
  • twitter

Method Description
/me/myday/share Upload either Title and/or Description and/or Delivery method to a myday share link. See Example4 for JSON data structure to include Title, Description and Delivery methods.
/me/comment create and share a comment with Title and/or Description and/or Delivery method
/OBJECTID/share upload either Title and/or Description and/or Delivery method to an object share link. Shareable objects are Journal, Location, Media, Place, Travel and User
/me/share send a message via email or facebook that you have joined HipGeo

Example4: me/myday/share

Create a share link for me/myday and add Title and/or Description and/or Delivery method.

POST http://api.hipgeo.com/me/myday/share?access_token=TOKENVALUE
{
   "title":"me/myday share Title with description and delivery",
   "description":"me/myday share Description with title and delivery",
   "delivery":{
      "email":[
         {
            "lastname":"flintstone",
            "firstname":"fred",
            "address":"fred@flintstone.com"
         },
         {
            "lastname":"rubble",
            "firstname":"barney",
            "address":"barney@rubble.com"
         }
      ],
      "sms":[
         {
            "lastname":"flintstone",
            "firstname":"fred",
            "address":"(818)456-7890"
         },
         {
            "lastname":"rubble",
            "firstname":"barney",
            "address":"(909)123-4567"
         }
      ],
      "facebook":{
         "page_id":"607068472",
         "access_token":"HSPJEHfZx1nU51-TRUNCATED-8SWyGjHqNMk5ZHkI59"
      },
      "twitter":{
         "oauth_token":"twitteroauthtoken",
         "oauth_token_secret":"twitteroauthtokensecret",
         "screen_name":"twitterhandle",
         "user_id":"twitteruid"
      },
      "friends":true
   }
}

Returns:
{
  "key":"4772ap",
  "id":"me.myday",
  "url":"hg\/r\/4772ap",
  "title":"me\/myday share Title with description and delivery",
  "description":"me\/myday share Description with title and delivery",
  "result":"success"
} 
Error Code Possible Errors
3
  1. Invalid date or time string [xxxx]
400
  1. Requires an ID
  2. Target is not a valid object
  3. Unable to parse post data
401
  1. Authentication failed
  2. Token expired
  3. 'me' requires authentication
  4. Insufficient permissions
403
  1. Authorization required
404
  1. Bad ID
405
  1. Not User ID
  2. You cannot view this user's day

Example5: me/comment

Create a share link when creating a comment. Include Title, Description and Delivery method.

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

Data:
{
   "comment":"This is the comment",
   "when":"2011-04-26 23:43:26",
   "gll":{
      "lat":33.9867,
      "lon":-117.827,
      "hacc":1,
      "vel":0,
      "when":"2011-04-25 23:43:26"
   },
   "share":{
      "title":"Title for comment share",
      "description":"Description for comment share",
      "delivery":{
         "email":[
            {
               "lastname":"flintstone",
               "firstname":"fred",
               "address":"fred@flintstone.com"
            },
            {
               "lastname":"rubble",
               "firstname":"barney",
               "address":"barney@rubble.com"
            }
         ],
         "sms":[
            {
               "lastname":"flintstone",
               "firstname":"fred",
               "address":"(818)456-7890"
            },
            {
               "lastname":"rubble",
               "firstname":"barney",
               "address":"(909)123-4567"
            }
         ],
         "facebook":{
            "page_id":"607068472",
            "access_token":"HSPJEHfZx1nU518SW--TRUNCATED--yGjHqNMk5ZHkI59QYLvT_k"
         },
         "twitter":{
            "oauth_token":"twitteroauthtoken",
            "oauth_token_secret":"twitteroauthtokensecret",
            "screen_name":"twitterhandle",
            "user_id":"twitteruid"
         },
         "friends":true
      }
   }
}

Returns:
{
  "id":"c_1092",
  "shareable":1,
  "jid":"j_17327",
  "type":"attached",
  "share":{
   "key":"hrcsbg",
   "id":"j_17327",
   "url":"hg\/r\/hrcsbg"
  },
  "result":"success"
} 
Error Code Possible Errors
400
  1. Unable to parse data
  2. Problem saving data: requires 'when'
  3. Comment field is empty
  4. Target is not a valid object
401
  1. Authentication failed
  2. Token expired
404
  1. ID not found
  2. Bad ID - malformed locationId
405
  1. Method must be POST
  2. Invalid target ID type - not a journal
  3. Invalid target ID

Example6: /OBJECTID/share

Create a share link for a Place object with Title and Description.

POST http://api.hipgeo.com/p_9472/share?access_token=TOKENVALUE

Data:
{
      "title":"Place share Title",
      "description":"Place share Description"
}


Returns:
{
   "key":"i3bu5f",
   "id":"p_9472",
   "url":"hipgeo.com\/r\/i3bu5f",
   "title":"Place share Title",
   "description":"Place share Description",
   "result":"success"
}
Error Code Possible Errors
400
  1. Requires an ID
  2. Target is not a valid object
  3. Unable to parse post data
401
  1. Authentication failed
  2. Token expired
  3. Insufficient permissions
403
  1. Authorization required
404
  1. Bad ID

Example7: /me/share

Create a share link for me object with Delivery.

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

Data:
{
   "delivery":{
      "email":[
         {
            "lastname":"flintstone",
            "firstname":"fred",
            "address":"fred@flintstone.com"
         }
      ],
      "facebook":{
         "page_id":"607068472",   
          "access_token":"HSPJEHfZx1nU518SW-TRUNCATED-yGjHqNMk5ZHkI59QYLvT"
      },
      "twitter":{
         "oauth_token":"twitteroauthtoken",
         "oauth_token_secret":"twitteroauthtokensecret",
         "screen_name":"twitterhandle",
         "user_id":"twitteruid"
      }
   }
}

Returns:
{
  "url":"hipgeo.com\/jonathan",
  "id":"u_222",
  "result":"success"
} 
Error Code Possible Errors
400
  1. Requires an ID
  2. Target is not a valid object
  3. Unable to parse post data
401
  1. Authentication failed
  2. Token expired
  3. Insufficient permissions
403
  1. Authorization required
404
  1. Bad ID
HipGeo Icon