get https://api.easyship.com/reference/v1/categories
API Resource URL
https://api.easyship.com/reference/v1/categories
##Request
curl --include \
--header "Content-Type: application/json" \
--header "Authorization: Bearer 4e2b327e2ef5471885cd0bc50a0c9fe52481793bd309b2c4f2a6bdac3f10ae1f" \
'https://api.easyship.com/reference/v1/categories'
var request = require('request');
request({
method: 'GET',
url: 'https://api.easyship.com/reference/v1/categories',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer 4e2b327e2ef5471885cd0bc50a0c9fe52481793bd309b2c4f2a6bdac3f10ae1f'
}}, function (error, response, body) {
console.log('Status:', response.statusCode);
console.log('Headers:', JSON.stringify(response.headers));
console.log('Response:', body);
});
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
headers = {
:content_type => 'application/json',
:authorization => 'Bearer 4e2b327e2ef5471885cd0bc50a0c9fe52481793bd309b2c4f2a6bdac3f10ae1f'
}
response = RestClient.get 'https://api.easyship.com/reference/v1/categories', headers
puts response
from urllib2 import Request, urlopen
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer 4e2b327e2ef5471885cd0bc50a0c9fe52481793bd309b2c4f2a6bdac3f10ae1f'
}
request = Request('https://api.easyship.com/reference/v1/categories', headers=headers)
response_body = urlopen(request).read()
print response_body
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.easyship.com/reference/v1/categories");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer 4e2b327e2ef5471885cd0bc50a0c9fe52481793bd309b2c4f2a6bdac3f10ae1f"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
var request = new XMLHttpRequest();
request.open('GET', 'https://api.easyship.com/reference/v1/categories');
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Authorization', 'Bearer 4e2b327e2ef5471885cd0bc50a0c9fe52481793bd309b2c4f2a6bdac3f10ae1f');
request.onreadystatechange = function () {
if (this.readyState === 4) {
console.log('Status:', this.status);
console.log('Headers:', this.getAllResponseHeaders());
console.log('Body:', this.responseText);
}
};
request.send();
##Response
{
"categories": [
{
"name": "Mobile Phones",
"slug": "mobile_phones"
},
{
"name": "Tablets",
"slug": "tablets"
},
{
"name": "Computers & Laptops",
"slug": "computers_laptops"
},
{
"name": "Cameras",
"slug": "cameras"
},
{
"name": "Accessory (no-battery)",
"slug": "accessory_no_battery"
},
{
"name": "Accessory (with battery)",
"slug": "accessory_with_battery"
},
{
"name": "Health & Beauty",
"slug": "health_beauty"
},
{
"name": "Fashion",
"slug": "fashion"
},
{
"name": "Watches",
"slug": "watches"
},
{
"name": "Home Appliances",
"slug": "home_appliances"
},
{
"name": "Home Decor",
"slug": "home_decor"
},
{
"name": "Toys",
"slug": "toys"
},
{
"name": "Sport & Leisure",
"slug": "sport_leisure"
},
{
"name": "Bags & Luggages",
"slug": "bags_luggages"
},
{
"name": "Audio Video",
"slug": "audio_video"
},
{
"name": "Documents",
"slug": "documents"
},
{
"name": "Jewelry",
"slug": "jewelry"
},
{
"name": "Dry Food & Supplements",
"slug": "dry_food_supplements"
},
{
"name": "Books & Collectibles",
"slug": "books_collectibles"
},
{
"name": "Pet Accessory",
"slug": "pet_accessory"
},
{
"name": "Gaming",
"slug": "gaming"
},
{
"name": "Board Games",
"slug": "board_games"
},
{
"name": "Shoes",
"slug": "shoes"
},
{
"name": "Health & Beauty (non-Liquid)",
"slug": "health_beauty_non_liquid"
}
]
}