To return dynamic data for command definitions in BiP Ussu Panel, define an External Link. REX forwards the user message to the provider WS address defined there. The provider analyzes the message and returns a dynamic reply (e.g., instead of a static “dollar” response, forward to WS and return current rate). Media responses (image, video, audio, rich media) should be uploaded to the FTS server by the provider.
All communication between the provider and REX is synchronous RESTful web service. Complete functionality tests in PRP before live integration.
| Server | Environment | URL |
|---|---|---|
| BiP USSU Panel | Production | https://bipussu.turkcell.com.tr/ |
| Server | Environment | URL |
|---|---|---|
| REX | PRP | From 86.108.192.4 IP, synchronous calls to Third Party WS on ports 80/443. |
| REX | Production | From 86.108.192.4 IP, synchronous calls to Third Party WS on ports 80/443. |
Expose a RESTful web service accepting JSON via HTTP/HTTPS POST. HTTP POST: no auth. HTTPS POST: basic auth with the service definition username/password. If REX receives HTTP codes other than 200 from the provider WS, it is treated as an error and is not retried.
Third Party URL // Provider WS URL receiving the user message.
| Field | Value | Description |
|---|---|---|
| keyword | string | The keyword match that caused the WS call. It is empty if routing occurred without a keyword match. |
| msgId | string | Unique ID of the message received from the BiP user. |
| transactionId | string | Counterpart trace ID for logs. |
| serviceId | number | Indicates which service the provider is receiving the message for. |
| receiveDate | Timestamp when the message arrived from the BiP user. | |
| sender | BiP user information. | |
| composition | Incoming message array. | |
| list | list | Contains the payload of the user’s message. |
| type | int | Message type. Possible values: 0 Text, 7 Location. |
| message | string | Message content. For text messages, this is the UTF-8 string displayed to the user. |
| data | Map | Optional key/value map that carries additional data. Currently used only for Location type. |
| subscriberData | Map | Optional key/value map populated if the service has the necessary permission. Not available to every service. |
Mevcut Key bilgileri; appVersion, locale, osType, osVersion
| Field | Value | Description |
|---|---|---|
| transactionId | string | Counterpart trace ID; the same value that was sent with the request must be returned. |
| composition | list | Incoming message array. |
| type | int | Message type. Possible values: 0 Text, 2 Image, 3 Audio, 4 Video, 5 Sticker, 6 Caps, 7 Location. |
| message | string | Message content. For text messages, this is the UTF-8 string the user will see. For image/audio/video, this is the URL of the media file. |
| data | Map | Optional key/value map whose contents depend on the message type. |
The data field in the map can contain different key/value values depending on the message type.
Currently only responses from the service provider to the REX API are supported.
Likewise, there is currently no usage for messages sent from the REX API to the service provider.
The size, width, and height information inside the map must be provided by the service provider that prepares the files. REX needs these values from the provider to keep operating efficiently.
Composition-specific map details depend on the message type:
TEXT: The map is empty.
IMAGE:
size: File size in bytes (numeric).width: Image width in pixels (numeric).height: Image height in pixels (numeric).AUDIO:
size: File size in bytes (numeric).VIDEO:
size: Video file size in bytes (numeric).width: Thumbnail width in pixels (numeric).height: Thumbnail height in pixels (numeric).STICKER: The map is empty.
CAPS:
size: File size in bytes (numeric).width: Width in pixels (numeric).height: Height in pixels (numeric).LOCATION:
lat: Latitude (numeric).lon: Longitude (numeric).When the BiP application sends a message toward the service, REX converts the content to JSON and issues a synchronous web service call to the provider URL. The provider should return the Composition message it wants to send back to the follower via REX. If no message should be returned, reply with null or an empty string.
Sending a type=0 (TEXT) message from a BiP user toward the service and forwarding that message to the external URL;
{
"keyword": "DOLAR",
"msgId": "unique-id-124",
"transactionId": "txid-1",
"serviceId": 8150,
"receiveDate": "26/02/2016 11:06:46",
"sender": "614d99f42ca4e7da4e23e96469efccbb",
"composition": {
"list": [
{
"type": 0,
"message": "hello bip",
"data": {}
}
]
}
}
Sending a type=7 (LOCATION) message from a BiP user toward the service and forwarding it to the external URL;
{
"keyword": "DOLAR",
"msgId": "unique-id-124",
"transactionId": "txid-1",
"serviceId": 8150,
"receiveDate": "26/02/2016 11:06:46",
"sender": "614d99f42ca4e7da4e23e96469efccbb",
"composition": {
"list": [
{
"type": 7,
"message": "",
"data": {
"lon": 29.117844,
"lat": 40.955395
}
}
]
}
}
Different message types being sent from the external URL back to the BiP user;
{
"transactionId": "txid-1",
"composition": {
"list": [
{
"type": 0,
"message": "hello bip",
"data": {}
},
{
"type": 4,
"message": "https://tims.turkcell.com.tr/scontent/p2p/30112015/17/Vfb16ee39112bccd28d1c38cf6d060480c8e16fef0cf3d8b3954199d9099cb61b1.mp4",
"data": {
"height": 308,
"width": 450,
"size": 162780
}
},
{
"type": 3,
"message": "https://tims.turkcell.com.tr/scontent/p2p/17122015/10/A1fe5b80bd40fc697dbf4ce74e89af471ed4534b250aec4c7b0694db6b34eb1191.mp3",
"data": {
"size": 162780
}
},
{
"type": 2,
"message": "https://tims.turkcell.com.tr/scontent/p2p/17122015/15/P56828a1016ab23fb0d45a492b58398562c665f75675c192bd7a3cf04e01c5e041.png",
"data": {
"height": 308,
"width": 450,
"size": 162780
}
},
{
"type": 6,
"message": "https://tims.turkcell.com.tr/scontent/caps/01780367452d6096377f4af7218d8785.jpg",
"data": {
"height": 308,
"width": 450,
"size": 162780
}
},
{
"type": 5,
"message": "https://tims.turkcell.com.tr/scontent/sticker/ebcc8b6cb43700fbf4a9f9cb632a3832.png",
"data": {}
},
{
"type": 7,
"message": "",
"data": {
"lon": 29.117844,
"lat": 40.955395
}
}
]
}
}