You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**NOTE:** Above params are needed for checksum generation. Please refer to the methods mention below.
17
17
18
+
Micro Module Params
19
+
| Key | Description |
20
+
| ----- | ----------- |
21
+
| MODULE_HANDLE | Each micromodule of a service provider is identified by MODULE_HANDLE |
22
+
| UUID | UniqueID to identify user session.|
18
23
19
-
**NOTE:** You will have to generate a checkSum from the parameters, headers with the secret key provided by appsfly.io.
24
+
Intent Params
25
+
| Key | Description |
26
+
| ----- | ----------- |
27
+
| INTENT | Intent is like an endpoint you are accessing to send message |
28
+
| PAYLOAD | Data payload |
20
29
21
30
# Integration options
22
-
### Option 1: Package
23
-
The SDK can be included to handle the encryption and decryption along with checkSum generation and verification.
24
-
You can use it to avoid boiler plate code. If not, you can use the api endpoint.
31
+
32
+
### Option 1: SDK
33
+
The SDK can be included to handle authorization. There is no need for you to handle checksum generation and verification.
25
34
26
35
#### Configuration
27
36
```
@@ -30,82 +39,42 @@ AppInstance.AFConfig config = new AppInstance.AFConfig("EXECUTOR_URL", "SECRET_K
30
39
#### Execution
31
40
```
32
41
AppInstance travelProvider = new AppInstance(config, "MODULE_HANDLE");
33
-
travelProvider.exec("INTENT", "PAYLOAD", new Callback() {
42
+
travelProvider.exec("INTENT", JSONObject("PAYLOAD"), "UUID", new Callback() {
34
43
@Override
35
44
public void onResponse(JSONObject response) {
36
-
System.out.println(response);
37
-
// Payment Done Response
38
45
// We have already verified the checksum from you
39
46
}
40
47
41
48
@Override
42
49
public void onError(JSONObject error) {
43
-
System.out.println(error);
50
+
// Handle error
44
51
}
45
52
});
46
53
```
47
54
48
-
### Option 2: API Endpoint ( "/executor/exec" )
55
+
### Option 2: API Endpoint
49
56
50
-
appsfly.io exposes a single API endpoint to access Microservices directly. Headers are used for authentication and sessions will be managed accordingly.
57
+
appsfly.io exposes a single API endpoint to access Microservices directly.
51
58
52
59
API endpoint : "https://microapps.appsfly.io/executor/exec"
53
60
54
-
#### Auth Headers
55
-
56
-
| Headers | Description |
57
-
| --- | --- |
58
-
| X-UUID | Unique ID of the execution. Generally it will be unique for unique user. |
| X-Module-Handle | Module Handle provided by service provider |
61
-
| X-Checksum | Checksum generated by appsfly.io utils |
62
-
| Content-Type | Content Type of body. Must be application/json |
63
-
64
-
#### Body Params
61
+
####
62
+
POST
65
63
66
-
| Body Parameters | Description |
64
+
#### Headers
65
+
| Header | Description |
67
66
| --- | --- |
68
-
| Intent:String| Intent String to access the service |
69
-
| data:JSON| Provide to execute the intent |
67
+
| X-UUID | UUID |
68
+
| X-App-Key | APP_KEY|
69
+
| X-Module-Handle | MODULE_HANDLE|
70
+
| X-Checksum | CHECKSUM. Please go through this gist to generate checksum. |
71
+
| Content-Type | Must be "application/json" |
72
+
73
+
#### Body
74
+
` {
75
+
"intent":"INTENT",
76
+
"data":"PAYLOAD"
77
+
} `
70
78
71
79
#### Response
72
-
73
-
Microservice will respond based on the intent provided along with the checksum (X-Checksum) in the headers. The checksum is the combination of the api response and the secret key.
0 commit comments