-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README-Alibaba API Client Interaction-1.eraserdiagram
55 lines (41 loc) · 1.3 KB
/
README-Alibaba API Client Interaction-1.eraserdiagram
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
50
51
52
53
54
sequence-diagram
// Sequence Diagram for Alibaba API Client
title Alibaba API Client Interaction
// Actors
User [icon: user, color: blue]
Client [icon: monitor, color: green]
EnvFile [icon: file, color: orange]
TaobaoAPI [icon: cloud, color: red]
// User initiates the script
User > Client: Run script (main.py)
activate Client
// Load environment variables
Client > EnvFile: Load .env file
EnvFile --> Client: Return API credentials
// Construct URL and payload
Client > Client: Construct URL and payload
// Create string to sign
Client > Client: Create string to sign
// Hash the string using MD5
Client > Client: Hash string using MD5
// Generate signature
Client > Client: Generate signature
// Add signature to payload
Client > Client: Add signature to payload
// Make POST request to Taobao API
Client > TaobaoAPI: POST request with payload
activate TaobaoAPI
// Loop until a valid response is received
loop [label: until valid response, color: lightblue] {
TaobaoAPI > Client: API response
alt [label: valid response, color: green] {
Client > User: Print response to console
}
else [label: invalid response, color: red] {
Client > Client: Modify request parameters
Client > TaobaoAPI: Retry POST request
}
}
deactivate TaobaoAPI
// End of script
deactivate Client