BiP Panel Commands

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.

Environment Info

All communication between the provider and REX is synchronous RESTful web service. Complete functionality tests in PRP before live integration.

ServerEnvironmentURL
BiP USSU PanelProductionhttps://bipussu.turkcell.com.tr/
ServerEnvironmentURL
REXPRPFrom 86.108.192.4 IP, synchronous calls to Third Party WS on ports 80/443.
REXProductionFrom 86.108.192.4 IP, synchronous calls to Third Party WS on ports 80/443.

Services and Authentication

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.

Message Delivery

Third Party URL // Provider WS URL receiving the user message.

Request
FieldValueDescription
keywordstringThe keyword match that caused the WS call. It is empty if routing occurred without a keyword match.
msgIdstringUnique ID of the message received from the BiP user.
transactionIdstringCounterpart trace ID for logs.
serviceIdnumberIndicates which service the provider is receiving the message for.
receiveDateTimestamp when the message arrived from the BiP user.
senderBiP user information.
compositionIncoming message array.
listlistContains the payload of the user’s message.
typeintMessage type. Possible values: 0 Text, 7 Location.
messagestringMessage content. For text messages, this is the UTF-8 string displayed to the user.
dataMapOptional key/value map that carries additional data. Currently used only for Location type.
subscriberDataMapOptional key/value map populated if the service has the necessary permission. Not available to every service.
  • Mevcut Key bilgileri; appVersion, locale, osType, osVersion

Response
FieldValueDescription
transactionIdstringCounterpart trace ID; the same value that was sent with the request must be returned.
compositionlistIncoming message array.
typeintMessage type. Possible values: 0 Text, 2 Image, 3 Audio, 4 Video, 5 Sticker, 6 Caps, 7 Location.
messagestringMessage 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.
dataMapOptional 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:

AUDIO:

VIDEO:

STICKER: The map is empty.

CAPS:

LOCATION:

Delivering the message to the service provider

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.

Examples

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
        }
      }
    ]
  }
}