API Endpoints

trip

The trip endpoint is used to create a trip and to retrieve summary information about a trip thru the Trip ID or more detailed information thru the Journal ID of the trip. The trip endpoint supports POST, PUT, GET methods used to create the trip, edit, and retrieve information about the trip.

POST

MethodDescription
/trip? create a trip with POST JSON data. Title, start, duration are required. See example below for JSON data structure

Example1: POST /trip

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

Data:
{
   "title":"this is my trip",
   "description":"this is why I like to fly",
   "tags":"tags,for,trip",
   "start":"2012-01-25 23:30:00",
   "duration":104400,
   "privacy":0
}

Returns:
{
  "id":"d_771",
  "jid":"j_123911",
  "post_count":5,
  "isfuture":0,
  "result":"success",
  "st":1331323713
} 
Error Code Possible Errors
400
  1. Unable to parse data
  2. Must be logged in to create a trip
  3. Start time is required
  4. Duration is required and cannot be zero
  5. Title is required
401
  1. Authentication failed
  2. Token expired
  3. Insufficient Permissions

PUT

MethodDescription
/TRIPID? modify a trip. Currently, start and duration cannot be modified. Title is required. See example below for JSON data structure

Example2: PUT /TRIPID

PUT http://api.hipgeo.com/d_476?access_token=TOKENVALUE

Data:
{
   "title":"this is modified trip titls",
   "description":"Modified description",
   "tags":"modified,tags,for,trip",
   "privacy":7
}

Returns:
{
  "id":"d_476",
  "jid":"j_79227",
  "result":"success"
} 
Error Code Possible Errors
400
  1. Unable to parse data
  2. Must be logged in to create a trip
  3. Start time cannot be modified
  4. Duration cannot be modified
  5. Title is required
401
  1. Authentication failed
  2. Token expired
  3. Insufficient Permissions
404
  1. Bad ID
  2. ID not found

GET

Retrieve trip summary or more detailed trip journal entry data.

MethodDescription
/TRIPID? get summary of trip using TRIPID
/JOURNALID? get trip journal information

Example3: GET /TRIPID

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

Returns:
{
  "slice":{
    "id":"d_476",
    "title":"this is my trip",
    "description":"this is why I like to fly",
    "start":"2012-01-25 23:30:00",
    "duration":104400,
    "privacy":0,
    "tags":"tags, for, trip"
  },
  "result":"success"
}
Error Code Possible Errors
401
  1. Authentication failed
  2. Token expired
  3. Insufficient Permissions
404
  1. Bad ID
  2. ID not found

Example4: GET /JOURNALID

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

Returns:
{
  "journalentry":{
    "id":"j_79227",
    "from":{
      "id":"u_214",
      "name":"Gerard",
      "shareable":1,
      "pingable":1,
      "url":"http:\/\/www.hipgeo.com\/Gerard",
      "fullname":"Gerard Chan",
      "avatar":{
        "id":"m_11101",
        "shareable":0,
        "type":0,
        "when":"2012-01-06 22:42:29",
        "icon":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_m?11101",
        "icon_l":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_l?11101",
        "icon_b":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_b?11101",
        "full":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_d?11101",
        "height":494,
        "width":662
      },
      "photo":"http:\/\/img.hipgeo.com\/4c0faecc4ffdb3c15ea72a5f0ee8fb58_b?11101"
    },
    "type":4,
    "when":"2012-01-27 12:30:00",
    "privacy":0,
    "user_modified":0,
    "shareable":1,
    "liked":0,
    "title":"this is my trip",
    "content":"this is why I like to fly",
    "tags":"tags, for, trip",
    "trip":{
      "id":"d_476",
      "title":"this is my trip",
      "description":"this is why I like to fly",
      "start":"2012-01-25 23:30:00",
      "duration":104400,
      "privacy":0,
      "tags":"tags, for, trip"
    },
    "commentcount":0,
    "likecount":"0",
    "mediacount":0
  },
  "result":"success"
}

Error Code Possible Errors
401
  1. Authentication failed
  2. Token expired
  3. Insufficient Permissions
404
  1. Bad ID
  2. ID not found
HipGeo Icon