Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Root
- curl https://blmc71vus7.execute-api.us-east-1.amazonaws.com/v1/
- Output:
- {"status": {"get": true}, "pickup/slots": {"get": true}, "type": {"get": true}, "price": {"get": true}, "/": {"get": true}}
- Should we change price to false?
- Type
- curl https://blmc71vus7.execute-api.us-east-1.amazonaws.com/v1/
- Output:
- {"linehaul": false, "dropoff": false, "pickup": true, "postal": false, "type": "pickup"}
- Status
- curl https://blmc71vus7.execute-api.us-east-1.amazonaws.com/v1/status
- Output:
- {"available": true, "limit": 30000, "timeout": false, "response_time": 4.08266806602478}
- Pickup
- curl -H "Content-Type: application/json" -X POST -d '{
- "requestor": {
- "name": "Djibril",
- "phone": "+855886697345",
- "company": "Nagadev"
- },
- "place": {
- "line1": "166 Street 118",
- "line2": "Sangkat Phsar Chaas",
- "package_location": "Phsaar",
- "city": "Paris",
- "post_code": "95380",
- "country_code": "FR"
- },
- "pickup": {
- "pickup_date": "2017-05-29",
- "slot_id": "11111",
- "ready_by_time": "01:00",
- "close_time": "23:00",
- "number_of_pieces": 1,
- "special_instructions": "Be careful its my computer"
- },
- "shipment_details": {
- "number_of_pieces": 1,
- "weight": 1
- }
- }' https://blmc71vus7.execute-api.us-east-1.amazonaws.com/v1/pickup
- Beware of pickup_date, ready_by_time and close_time. Those value should be realistic or an error will be returned.
- Output:
- [{"requestor": {"phone": "+855886697345", "company": "Nagadev", "name": "Djibril"}, "pickup": {"ready_by_time": "01:00", "close_time": "23:00", "special_instructions": "Be careful its my computer", "slot_id": "11111", "pickup_date": "2017-05-29", "number_of_pieces": 1}, "place": {"city": "Paris", "post_code": "95380", "line2": "Sangkat Phsar Chaas", "line1": "166 Street 118", "country_code": "FR", "package_location": "Phsaar"}, "pickup_id": "245", "shipment_details": {"number_of_pieces": 1, "weight": 1}}]
- Label
- curl -H "Content-Type: application/json" -X POST -d '{
- "origin": {
- "name": "Djibou",
- "first_name": "Djibril",
- "last_name": "Cisse",
- "company": "Nagadev",
- "line1": "12 rue de Puiseux",
- "line2": "Corner Pinsons",
- "state": "IDF",
- "zipcode": "95380",
- "country": "France",
- "country_code": "FR",
- "phone": "+33632129547",
- "email": "djisse@gmail.com"
- },
- "destination": {
- "name": "TiTin",
- "first_name": "Hamly",
- "last_name": "Tin",
- "company": "Nagadev",
- "line1": "118 Street 118",
- "line2": "Phsaar Kandal",
- "state": "PP",
- "zipcode": "0000",
- "country": "Cambodia",
- "country_code": "KH",
- "phone": "+855886697345",
- "email": "hamly@gmail.com"
- },
- "parcel": {
- "length_in_cm": 100,
- "width_in_cm": 100,
- "height_in_cm": 100,
- "weight_in_grams": 1000
- },
- "dropoff_informations": {
- "dropoff_point_id": "none"
- },
- "metadata": {
- "RMA": "Here is metadata"
- }
- }' https://blmc71vus7.execute-api.us-east-1.amazonaws.com/v1/label
- Output:
- {"origin": {"first_name": "Djibril", "last_name": "Cisse", "name": "Djibou", "country": "France", "company": "Nagadev", "line2": "Corner Pinsons", "line1": "12 rue de Puiseux", "zipcode": "95380", "phone": "+33632129547", "state": "IDF", "country_code": "FR", "email": "djisse@gmail.com"}, "label_url": "https://s3-us-west-2.amazonaws.com/srbstickers/1495774749.97.pdf", "destination": {"first_name": "Hamly", "last_name": "Tin", "name": "TiTin", "country": "Cambodia", "company": "Nagadev", "line2": "Phsaar Kandal", "line1": "118 Street 118", "zipcode": "0000", "phone": "+855886697345", "state": "PP", "country_code": "KH", "email": "hamly@gmail.com"}, "parcel": {"weight_in_grams": 1000, "width_in_cm": 100, "height_in_cm": 100, "length_in_cm": 100}, "shipment_id": "1045549750"}
- Pickup/Slots
- curl https://blmc71vus7.execute-api.us-east-1.amazonaws.com/v1/pickup/slots
- Output
- [{"date": "2017-05-27 05:13:30.756935", "slots": [{"duration": 646, "start_time": "2017-05-27 16:00:00:000Z", "availability": 0}, {"duration": 766, "start_time": "2017-05-27 18:00:00:000Z", "availability": 0}]}, {"date": "2017-05-28 05:13:30.756935", "slots": [{"duration": 646, "start_time": "2017-05-28 16:00:00:000Z", "availability": 0}, {"duration": 766, "start_time": "2017-05-28 18:00:00:000Z", "availability": 0}]}, {"date": "2017-05-29 05:13:30.756935", "slots": [{"duration": 646, "start_time": "2017-05-29 16:00:00:000Z", "availability": 0}, {"duration": 766, "start_time": "2017-05-29 18:00:00:000Z", "availability": 0}]}, {"date": "2017-05-30 05:13:30.756935", "slots": [{"duration": 646, "start_time": "2017-05-30 16:00:00:000Z", "availability": 0}, {"duration": 766, "start_time": "2017-05-30 18:00:00:000Z", "availability": 0}]}, {"date": "2017-05-31 05:13:30.756935", "slots": [{"duration": 646, "start_time": "2017-05-31 16:00:00:000Z", "availability": 0}, {"duration": 766, "start_time": "2017-05-31 18:00:00:000Z", "availability": 0}]}, {"date": "2017-06-01 05:13:30.756935", "slots": [{"duration": 646, "start_time": "2017-06-01 16:00:00:000Z", "availability": 0}, {"duration": 766, "start_time": "2017-06-01 18:00:00:000Z", "availability": 0}]}, {"date": "2017-06-02 05:13:30.756935", "slots": [{"duration": 646, "start_time": "2017-06-02 16:00:00:000Z", "availability": 0}, {"duration": 766, "start_time": "2017-06-02 18:00:00:000Z", "availability": 0}]}]
- A little bit slow because of th 7 queries... we are looking for a way to fix this issue. But it's working already.
- Question: For "duration": It's the timelapse in minute between now and the pickup slot right? Could you confirm it plz, because for the last slot, 7 days after the timelapse in minute will be very high. Actually it's the timelapse betweend the current time and the pickup.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement