Table of Contents

    API

    Mock Server

    Use this URL to access a mockup of the API server. Your traffic will be recorded and compared to the documentation. You'll find your traffic analysis in the inspector or directly here in the documentation, right next to each resource.

Twistory

Version: v1

Resources

States

State Collection

List the name and the path to its detailed page of all states

GET

/api/states

Response

200 (OK)
Content-Type: application/json
Link: <http://idb14.apiary-mock.com/api/states>
Date: <Tue, 15 Dec 2054 03:11:21 GMT>
Accept-Language: <en-us>
{
 "Utah": "/api/states/Utah"  

 "Texas": "/api/states/Texas"

 "California": "/api/states/California"
 }

State

List all info of the state with the given name

GET

/api/states/state_name

Parameters
Name Description Details
state_name string, required
example: GET /api/states/Texas

Response

200 (OK)
Content-Type: application/json
Link: <http://idb14.apiary-mock.com/states.json/Utah>
Date: <Tue, 15 Dec 2054 03:11:21 GMT>
Accept-Language: <en-us>
{
    "name": "Utah", "date_founded": "1/4/1896", "population": "29000872",
           "size(sqml)": "84899", "video": "link to video", "flag": "link to pic of flags"
    "parks": {"Zion": "/api/parks/Zion"},
 }

Response

404 (Not Found)
Content-Type: application/json
{
    "error": "This id does not exsit in the file."
}

Parks

Park Collection

List the name and the path to its detailed page of all parks

GET

/api/parks

Response

200 (OK)
Content-Type: application/json
Link: <http://idb14.apiary-mock.com/api/parks>
Date: <Tue, 15 Dec 2054 03:11:21 GMT>
Accept-Language: <en-us>
{
 "Zion" : "/api/parks/Zion",
 "Yosemite" : "/api/parks/Yosemite" 
 "Denail" : "/api/parks/Denail"
}

Park

List all info of the park with the given name

GET

/api/parks/park_name

Parameters
Name Description Details
park_name string, required
example: GET /api/parks/Grand Cayon

Response

200 (OK)
Content-Type: application/json
Link: <http://idb14.apiary-mock.com/api/parks/Yosemite>
Date: <Tue, 15 Dec 2054 03:11:21 GMT>
Accept-Language: <en-us>
{
    "name": "Yosemite", "size(acres)": "747956", "date_founded": "12/02/1982", "image": "link to image",
    "max_elevation(ft)": 13114, "visitors(annual)": "100000", "video": "link to video,
    "state": "California, "hikes": {"Mirror Lake Loop": "/api/hikes/Mirror Lake Loop", "Hallet Peak": "/api/hikes/Hallet Peak"}        
}

Response

404 (Not Found)
Content-Type: application/json
{
    "error": "This id does not exsit in the file."
}

Hikes

Hike Collection

List the name and the path to the detailed page of all hikes

GET

/api/hikes

Response

200 (OK)
Content-Type: application/json
Link: <http://idb14.apiary-mock.com/api/hikes>
Date: <Tue, 15 Dec 2054 03:11:21 GMT>
Accept-Language: <en-us>
{
    "Mirror Lake Loop": "/api/hikes/Mirror Lake Loop"

    "Hallet Peak", "/api/hikes/Hallet Peak"
]

Hike

List all info of the hike with the given name

GET

/api/hikes/hike_name

Parameters
Name Description Details
hike_name string, required
example: GET /api/hike/Mirror Lake Loop

Response

200 (OK)
Content-Type: application/json
Link: <http://idb14.apiary-mock.com/api/hikes/Mirror Lake Loop>
Date: <Tue, 15 Dec 2054 03:11:21 GMT>
Accept-Language: <en-us>
{
    "name": "Mirror Lake Loop", "distance(mile)": "5",
    "est_time(min)": "90 min", "difficulty": "moderate", "image": "link to pic"
    "park": "Yosemite"          
} 

Response

404 (Not Found)
Content-Type: application/json
{
    "error": "This id does not exsit in the file."
}