post https://api.easyship.com/pickup/v1/direct_handover
API Resource URL
##Request
curl --include \
--request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer 77af10e030c4fc85fc0738fbd5a8945722c261996ae2bfb5a0e5e974d591c83f" \
--data-binary "{
\"easyship_shipment_ids\": [
\"ESUS3171766\"
]
}" \
'https://api.easyship.com/pickup/v1/direct_handover'
var request = require('request');
request({
method: 'POST',
url: 'https://api.easyship.com/pickup/v1/direct_handover',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer 77af10e030c4fc85fc0738fbd5a8945722c261996ae2bfb5a0e5e974d591c83f'
},
body: "{ \"easyship_shipment_ids\": [ \"ESUS3171766\" ]}"
}, 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'
values = '{
"easyship_shipment_ids": [
"ESUS3171766"
]
}'
headers = {
:content_type => 'application/json',
:authorization => 'Bearer 77af10e030c4fc85fc0738fbd5a8945722c261996ae2bfb5a0e5e974d591c83f'
}
response = RestClient.post 'https://api.easyship.com/pickup/v1/direct_handover', values, headers
puts response
from urllib2 import Request, urlopen
values = """
{
"easyship_shipment_ids": [
"ESUS3171766"
]
}
"""
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer 77af10e030c4fc85fc0738fbd5a8945722c261996ae2bfb5a0e5e974d591c83f'
}
request = Request('https://api.easyship.com/pickup/v1/direct_handover', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.easyship.com/pickup/v1/direct_handover");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{
\"easyship_shipment_ids\": [
\"ESUS3171766\"
]
}");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer 77af10e030c4fc85fc0738fbd5a8945722c261996ae2bfb5a0e5e974d591c83f"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
var request = new XMLHttpRequest();
request.open('POST', 'https://api.easyship.com/pickup/v1/direct_handover');
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Authorization', 'Bearer 77af10e030c4fc85fc0738fbd5a8945722c261996ae2bfb5a0e5e974d591c83f');
request.onreadystatechange = function () {
if (this.readyState === 4) {
console.log('Status:', this.status);
console.log('Headers:', this.getAllResponseHeaders());
console.log('Body:', this.responseText);
}
};
var body = {
'easyship_shipment_ids': [
'ESUS3171766'
]
};
request.send(JSON.stringify(body));
##Response
{
"direct_handover": {
"easyship_shipment_ids": [
"ESUS3171766"
],
"pickup_state": "completed"
}
}