-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_api.py
49 lines (44 loc) · 2.33 KB
/
test_api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# run at src directory
from sdk_python import SdkPython
deliveree_sdk = SdkPython()
print(deliveree_sdk.get_quote(
api_key = "",
time_type = "schedule",
pickup_time = "2021-06-08T11:54:10.662Z",
vehicle_type_id = 107,
packs = [{"dimensions":["120","100","80"],"weight":"15","quantity":1}],
locations = [{"address": "Jakarta, Indonesia", "latitude": -6.2087634, "longitude": 106.845599},
{"address": "Bandung Trade Mall, Jalan Kiara Condong, Babakan Surabaya, Bandung City, Tây Java, Indonesia",
"latitude": -6.911497199999999, "longitude": 107.6443171}]
)) # ok
print(deliveree_sdk.create_dlvr(
api_key = "",
vehicle_type_id = 107,
note = "Fragile item that needs good care.",
time_type = "now",
pickup_time = "2016-05-13T09:51:16+07:00",
job_order_number = "66666",
locations = [
{
"address": "Wisma Anugraha, Jl. Taman Kemang No.32B, RT.14/RW.1, Bangka, Kec. Mampang Prpt., Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12730, Indonesia",
"latitude": -6.257851,
"longitude": 106.8098256,
"recipient_name": "name",
"recipient_phone": "1232132"
},
{
"address": "Deliveree Indonesia",
"latitude": -6.2578501,
"longitude": 106.8097371,
"need_cod": True,
"cod_invoice_fees": 5000,
"need_pod": True,
"recipient_name": "name",
"recipient_phone": "1232132"
}
]
)) # ok
print("get_vehicle_types: ", deliveree_sdk.get_vehicle_types("")) # ok
print("get_list_dlvr: ", deliveree_sdk.get_list_dlvr("")) # ok
print("get_dlvr: ", deliveree_sdk.get_dlvr(api_key = "", id = '35549')) # ok
print("cancel_dlvr: ", deliveree_sdk.cancel_dlvr(api_key = "", id = '35586')) # <Response [405]> I see code is ok.