Adding examples

This commit is contained in:
0x6f736f646f
2020-03-11 22:50:00 +03:00
parent 60881efdca
commit afa323ef3e
3 changed files with 122 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import requests
values = """
{
"command": "cancel",
"data": {
"api_key": "aOYE0BD3rz03QKPXUx4R",
"api_username": "qualis",
"order_no": "AN82TT944-33W"
},
"request_token_id": "request_token_id"
}
"""
headers = {
'Content-Type': 'application/json'
}
url = 'https://apitest.sendyit.com/v1/#cancel'
request = requests.post(url, data=values, headers=headers)
response_body = request.text
print(response_body)
+74
View File
@@ -0,0 +1,74 @@
import requests
values = """
{
"command": "request",
"data": {
"api_key": "aOYE0BD3rz03QKPXUx4R",
"api_username": "qualis",
"vendor_type": 1,
"rider_phone": "0728561783",
"from": {
"from_name": "Green House",
"from_lat": -1.300577,
"from_long": 36.78183,
"from_description": ""
},
"to": {
"to_name": "KICC",
"to_lat": -1.28869,
"to_long": 36.823363,
"to_description": ""
},
"recepient": {
"recepient_name": "Sender Name",
"recepient_phone": "0709779779",
"recepient_email": "sendyer@gmail.com",
"recepient_notes": "recepient specific Notes"
},
"sender": {
"sender_name": "Sendyer Name",
"sender_phone": "0709 779 779",
"sender_email": "sendyer@gmail.com",
"sender_notes": "Sender specific notes"
},
"delivery_details": {
"pick_up_date": "2016-04-20 12:12:12",
"collect_payment": {
"status": false,
"pay_method": 0,
"amount": 10
},
"return": true,
"note": " Sample note",
"note_status": true,
"request_type": "delivery",
"order_type": "ondemand_delivery",
"ecommerce_order": false,
"express": false,
"skew": 1,
"package_size": [
{
"weight": 20,
"height": 10,
"width": 200,
"length": 30,
"item_name": "laptop"
}
]
}
},
"request_token_id": "request_token_id"
}
"""
headers = {
'Content-Type': 'application/json'
}
url = "https://apitest.sendyit.com/v1/##request"
request = requests.post(url, data=values, headers=headers)
response_body = request.text
print(response_body)
+24
View File
@@ -0,0 +1,24 @@
import requests
values = """
{
"command": "track",
"data": {
"api_key": "aOYE0BD3rz03QKPXUx4R",
"api_username": "qualis",
"order_no": "AN82G6946-4SA"
},
"request_token_id": "request_token_id"
}
"""
headers = {
'Content-Type': 'application/json'
}
url = "https://apitest.sendyit.com/v1/#track"
request = requests.post(url, data=values, headers=headers)
response_body = request.text
print(response_body)