Sending Events via REST API

Request

Method Request URL
POST https://{clientEndpointId}- fane01.servicebus.windows.net/{eventTypeName}/messages?tim eout=60&api-version=2014-01

You will receive your clientEndpointId after the integration meeting, for example: casinomagic.
You can set the eventTypeName to match your own terminology, for example: spins

 

 

Request Headers

Content-type

application/vnd.microsoft.servicebus.json

Authorisation

Future Anthem provided SharedAccessSignature token

x-ms-retrypolicy 

NoRetry

 

Request body

JSON formatted event data - either a single event or a list of batched events.
All JSON payloads have to be String escaped and passed as the value to the “Body” key.

JSON (single event) JSON (batch events)
[{“Body”:”{\"Key1\":\"Value1\ "}”}] \ "}”}] [{“Body”:”{\"Key1\":\"Value1\"}”}, {“Body”:”{\"Key1\":\"Value2\"}”}]

JSON Schema Example

{ 
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "array",
"title": "Real-time Event Upload",
"description": "Schema definition for real-time events uploaded to Future Anthem",
"default": [],
"examples": [
[
{
"Body":
"{\"GameId\":\"1\",\"PlayerId\":\"123\",\"SpinId\": 1,\"Amount\": 0.25}"
}
]
],
"additionalItems": true,
"items": {
"$id": "#/items",
"anyOf": [
{
"$id": "#/items/anyOf/0",
"type": "object",
"title": "Event Schema",
"description": "The schema of a single event",
"default": {},
"examples": [
{
"Body":
"{\"GameId\":\"1\",\"PlayerId\":\"123\",\"SpinId\": 1,\"Amount\": 0.25}"
}
],
"required": [
"Body"
],
"properties": {
"Body": {
"$id": "#/items/anyOf/0/properties/Body",
"type": "string",
"title": "Event Body Schema",
"description": "The event Payload",
"default": "",
"examples": [
"{\"GameId\":\"1\",\"PlayerId\":\"123\",\"SpinId\": 1,\"Amount\": 0.25}"
]
}
},
"additionalProperties": true
}
]
}
}
 

API Response

  • HTTP status codes: 201 (Created), 401 (Authorisation failure), 500 (Internal error)
  • If the response is successful, the response body is empty.
  • If the request isn't successful, the body contains an error code and error message

API Call Examples

POST /spins/messages?timeout=60&api-version=2014-01 HTTP/1.1
Host: https://casinomagic-fane01.servicebus.windows.net
Authorization: SharedAccessSignature sr=casinomagic-
fane01.servicebus.windows.net&sig=casinomagic
token&se=1657122931&skn=upload
Content-Type: application/vnd.microsoft.servicebus.json
[{"Body": "{\"GameId\":\"1\",\"PlayerId\":\"123\",\"SpinId\":
1,\"Amount\": 0.25}"}]
curl --location --request POST 'https://casinomagic-
fane01.servicebus.windows.net/spins/messages?timeout=60&api-version=2014- 01' \
--header 'Content-Type: application/vnd.microsoft.servicebus.json' \
--header 'Authorization: SharedAccessSignature
sr=https%3A%2F%2Fcasinomagic-
fane01.servicebus.windows.net%2Fspins&sig=casinomagic-
token&se=1657122931&skn=upload' \
--data-raw '[{"Body": "{\"GameId\":\"1\",\"PlayerId\":\"123\",\"SpinId\":
1,\"Amount\": 0.25}"}]'