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
| Method | Description |
| /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 |
- Unable to parse data
- Must be logged in to create a trip
- Start time is required
- Duration is required and cannot be zero
- Title is required
|
| 401 |
- Authentication failed
- Token expired
- Insufficient Permissions
|
PUT
| Method | Description |
| /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 |
- Unable to parse data
- Must be logged in to create a trip
- Start time cannot be modified
- Duration cannot be modified
- Title is required
|
| 401 |
- Authentication failed
- Token expired
- Insufficient Permissions
|
| 404 |
- Bad ID
- ID not found
|
GET
Retrieve trip summary or more detailed trip journal entry data.
| Method | Description |
| /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 |
- Authentication failed
- Token expired
- Insufficient Permissions
|
| 404 |
- Bad ID
- 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 |
- Authentication failed
- Token expired
- Insufficient Permissions
|
| 404 |
- Bad ID
- ID not found
|