{"openapi":"3.0.1","info":{"title":"nanocosmos Cloud Token Service (CTS)","description":"# Info\n© 2026 nanocosmos GmbH. All Rights Reserved.\n\nThe **C**loud**T**oken**S**ervice (CTS) allows you to create secure and time-limited access to a specific service within the nanoStream Cloud. This is accomplished using **J**SON**W**eb**T**oken (JWT), an established and secure web standard. All tokens are signed with a strong asymetric cryptography scheme (`RSA` or `EdDSA`). The use of tokens offers you several advantages, such as:\n  - create time-limited access permission for a specific service sharing access with third parties without giving full access to your organisation \n  - the possibilty to do an independent validation through private/public key scheme\n  - revoke tokens before their expiration time (optional revocable tokens feature)\n  - automatically disconnect active playback sessions when tokens expire (optional force disconnect feature)","version":"1.7.0"},"servers":[{"url":"https://token.nanostream.cloud","description":"Main server"}],"security":[{"X-BINTU-TOKEN":[]},{"X-BINTU-APIKEY":[]}],"tags":[{"name":"Bintu"},{"name":"NanoMeet"},{"name":"Webcaster"},{"name":"H5Live Playback"}],"components":{"securitySchemes":{"X-BINTU-TOKEN":{"type":"apiKey","in":"header","name":"X-BINTU-TOKEN","description":"Unique identifier of an organisation *with time limit*, which gives access rights to perform API calls. E.g. `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9`"},"X-BINTU-APIKEY":{"type":"apiKey","in":"header","name":"X-BINTU-APIKEY","description":"Unique identifier of an organisation *without time limit*, which gives access rights to perform API calls. E.g. `OGvhN2a5hQCCuMh5Fb8IVWGzb0kMyl7dw1Ir7d`"}},"schemas":{"token":{"description":"(**Required**) A (`JWT`) Token-String.","type":"string","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ..."},"revocable":{"description":"(**Optional**) Set to `true` to create a revocable token. Revocable tokens can be invalidated before their expiration time using the `/api/v1/splay/revoke` endpoint. **Note:** Revocable tokens have a maximum expiration time of 24 hours.","type":"boolean","default":false,"example":true},"forceDisconnect":{"description":"(**Optional**) Set to `true` to automatically disconnect active playback sessions when the token expires. When a viewer connects with a force disconnect token, their playback session will be terminated as soon as the token reaches its expiration time (`exp`). This ensures that access is revoked immediately upon token expiration, even for ongoing sessions. **Use case:** Ideal for time-limited content access where you need to ensure viewers cannot continue watching after the allowed time period ends.","type":"boolean","default":false,"example":true},"ip":{"description":"(**Optional**) Restrict the token to one or more IPv4 addresses or IPv4 CIDR ranges. Accepts either a single string or an array of entries. Each entry must be a bare IPv4 address (exact match, e.g. `203.0.113.42`) or an IPv4 CIDR range (network match, e.g. `203.0.113.0/24`). An array may contain **up to 10 entries**; entries are sanitized before validation (whitespace trimmed, blanks dropped, exact duplicates removed). Invalid entries are rejected with a parameter validation error identifying the index of the invalid entry.","oneOf":[{"type":"string","description":"A single bare IPv4 address (exact match, e.g. `203.0.113.42`) or IPv4 CIDR range (network match, e.g. `203.0.113.0/24`).","example":"203.0.113.42"},{"type":"array","description":"An array of **up to 10** entries, each a bare IPv4 address (exact match) or IPv4 CIDR range (network match). Entries are sanitized before validation: whitespace is trimmed, blank entries are dropped, and exact duplicates are removed. Invalid entries are rejected with a parameter validation error identifying the index of the invalid entry.","items":{"type":"string"},"maxItems":10,"example":["203.0.113.42","198.51.100.0/24"]}]},"domain":{"description":"(**Optional**) Restrict the token to a specific domain. When set, the token will only be accepted when the request originates from the specified domain.","type":"string","example":"example.com"},"user":{"description":"(**Optional**) Additional information about the user of the token. Can be used to identify or track token usage per user.","type":"string","example":"1f3542f2-42ca-4c33-9f05-daedc7dfb44f"},"exp":{"description":"(**Optional**) The parameter `exp` stands for \"expires\" and defines the time at which the token loses its validity. After the expiration, the token can no longer be used. This parameter can be specified as a Unix-Timestamp (`1635638400`). If this parameter is not specified, a **default of 24 hours** is used.","type":"number","example":1635638400},"nbf":{"description":"(**Optional**) The parameter `nbf` stands for \"not before\" and defines a time in the future when the token becomes valid. It is not possible to use the token before the defined time is reached. This parameter can be specified as a Unix-Timestamp (`1635638400`). If this parameter is not specified, the `nbf` is automatically set to the creation date, so the token is immediately valid.","type":"number","example":1635638400},"roomname":{"type":"string","description":"(**Required**) A room name can be freely chosen. A room name can consist of the following characters: `A-Za-z0-9_`, please note that special and whitespace characters are not supported.","example":"nanomeet_demo"},"streamname":{"type":"string","description":"(**Required**) An existing stream of your organisation on which nanoMeet can broadcast your meeting.","example":"abcde-fghij"},"moderator":{"type":"boolean","description":"(**Optional**) A moderator is a special user with privileged rights for a meeting. He has the possibility to broadcast the meeting via the nanostream cloud to a larger audience and to invite new participants to a meeting. If this parameter is not specified, the **default `nanomeet-us.nanocosmos.de`** is used."},"server":{"type":"string","description":"(**Optional**) We provide nanoMeet-servers in several regions. The selected region should be as close as possible to the majority of the meetings audience to ensure low latency. If not specified it **defaults to `nanomeet-eu.nanocosmos.de`**. **Available regions** EU: `nanomeet-eu.nanocosmos.de` US-East: `nanomeet-us.nanocosmos.de`","example":"nanomeet-us.nanocosmos.de"},"ingesturl":{"type":"string","description":"(**Required**) Depending on the booked features of your organisation, several endpoints are available to you.\n\n**Ingest-Endpoints** \n- Live: `rtmp://bintu-stream.nanocosmos.de:1935/live` \n- Record (VoD): `rtmp://bintu-stream.nanocosmos.de:1935/rec`","example":"rtmp://bintu-stream.nanocosmos.de:1935/rec"},"streams":{"description":"A collection of stream **names**","type":"array","items":{"type":"string"},"example":["S9I9O-u3Bjd","S9I9O-0oUs7","S9I9O-9uzxs"]},"orgawide":{"type":"boolean","description":"Token which is valid for every stream within the organisation. **Recommendation:** Do not share with your customers. ","example":true},"groupid":{"type":"string","description":"Unique identifier for the group.","example":"1f3542f2-42ca-4c33-9f05-daedc7dfb44f"},"aud":{"type":"array","items":{"type":"string","enum":["bintu","secure-conference","guardian","metrics","splay"]},"example":["bintu","splay","metrics"],"description":"(**Optional**) The parameter `aud` stands for `Audience` and is giving the scope of action of the token. These tokens can be used throughout multiple services (`bintu`, `secure-conference`, `metrics`, `guardian`, `splay`). If this parameter is not specified, the **`aud` is automatically set to `bintu` only**. For security reasons, we advise to keep the scope as small as possible to improve security."},"iss":{"type":"string","description":"(**Optional**) The parameter `iss` stands for `Issuer` and is the internal identifier of an user of your organization. If this parameter is not specified, the token will have full access to the audiences you defined as a parameter.","example":"1f3542f2-42ca-4c33-9f05-daedc7dfb44f"},"custom":{"type":"string","description":"(**Optional**) The parameter `custom` allows you to store additional information as a string in your jwt.","example":"Token issued for service XXX"},"expBintu":{"type":["number","string"],"description":"(**Optional**) The parameter `exp` stands for `Expires` and is the time at which the token loses its validity. After the expiration, the token can no longer be used. This parameter can be specified as an Unix-Timestamp (`1635638400`). With the apikey, you can create token with a **maximum expiration time of a year**. If this parameter is not specified, a **default of 24 hours** is used. We recommend keeping the expiration to 24 hours and request a new token if needed.","example":"1724832286"},"nbfBintu":{"type":["number","string"],"description":"(**Optional**) The parameter `nbf` stands for `NotBefore` and is the time in the future when the token becomes valid. It is not possible to use the token before this time is reached. This parameter can be specified as an Unix-Timestamp (`1635638400`). **If this parameter is not specified, the `nbf` is automatically set to the creation date, so the token is immediately valid.**","example":"1724832286"},"jti":{"type":"string","description":"The parameter `jti` stands for `JWT ID` and is an internal identifier for the token.","example":"aJf6YyBr"},"sub":{"type":"string","description":"The parameter `sub` stands for `subject` and is the identifier for the organization bound to this token.","example":"1f3542f2-42ca-4c33-9f05-daedc7dfb44f"},"hash":{"type":"string","description":"The parameter `hash` is an internal Bintu identifier for organizations","example":"dtaJO"},"metrics":{"type":"string","description":"The parameter `metrics` shows how much access this organization on the metrics feature","example":"full"},"permissions":{"type":"string","description":"The permission field is containing internal information on the permissions of this token"},"iat":{"type":"number","description":"The `iat` field stands for `issued at`, meaning the time the token was created"},"200Token":{"description":"OK","example":{"success":true,"data":{"token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ..."}}},"200TokenVerified":{"description":"OGvhN2a5hQCCuMh5Fb8IVWGzb0kMyl7dw1Ir7d","properties":{"aud":{"$ref":"#/components/schemas/aud"},"exp":{"$ref":"#/components/schemas/expBintu"},"nbf":{"$ref":"#/components/schemas/nbfBintu"},"iss":{"$ref":"#/components/schemas/iss"},"custom":{"$ref":"#/components/schemas/custom"},"jti":{"$ref":"#/components/schemas/jti"},"sub":{"$ref":"#/components/schemas/sub"},"hash":{"$ref":"#/components/schemas/hash"},"metrics":{"$ref":"#/components/schemas/metrics"},"permissions":{"$ref":"#/components/schemas/permissions"}},"example":{"success":true,"data":{"aud":["bintu"],"exp":1724919726,"nbf":1724860523,"jti":"WimU0kXy","sub":"1f3542f2-42ca-4c33-9f05-daedc7dfb44f","hash":"dtaJO,","metrics":"full","iat":1724860523}}},"Unauthorized_APIkey":{"description":"Unauthorized","example":{"success":false,"errorCode":13,"message":"API key is invalid"}},"Unauthorized_JWT":{"description":"Unauthorized","example":{"success":false,"errorCode":11,"message":"Authorization token verification failed"}},"TokenNeverValid":{"description":"Bad request","example":{"success":false,"errorCode":3002,"message":"You are trying to create a token which never becomes valid."}},"SPlayTokenNeverValid":{"description":"Bad request","example":{"success":false,"errorCode":2007,"message":"Token will never become valid"}},"MaxExpirationReached":{"description":"Bad request","example":{"success":false,"errorCode":3000,"message":"Your token expires too far in the future (max 365 days)"}},"TokenNotRevocable":{"description":"Bad request","example":{"success":false,"errorCode":2011,"message":"The token is not allowed for revocation"}},"TokenWrongOrganization":{"description":"Forbidden","example":{"success":false,"errorCode":2012,"message":"The provided token doesent belong to your organisation"}},"MalformedJWT":{"description":"Bad request","example":{"success":false,"errorCode":2004,"message":"Malformed JWT"}},"ExpTooFarInFuture":{"description":"The provided `exp` is too far in the future","example":{"success":false,"errorCode":2005,"message":"Provided timestamp for parameter (exp) is too far in the future"}},"ExpInPast":{"description":"The provided `exp` is in the past","example":{"success":false,"errorCode":2006,"message":"Provided timestamp for parameter (exp) is in the past"}},"NbfTooFarInFuture":{"description":"The provided `nbf` is too far in the future","example":{"success":false,"errorCode":2005,"message":"Provided timestamp for parameter (nbf) is too far in the future"}},"NbfInPast":{"description":"The provided `nbf` is in the past","example":{"success":false,"errorCode":2006,"message":"Provided timestamp for parameter (nbf) is in the past"}},"InvalidIpEntry":{"description":"An entry in the `ip` array is not a valid IPv4 address or IPv4 CIDR range","example":{"success":false,"errorCode":1001,"message":"Provided value for parameter: ip doesn't match requirements. Reason: IP at index 1 is not a valid IPv4 or CIDR: \"999.999.999.999\""}},"TooManyIpEntries":{"description":"The `ip` array contains more entries than allowed","example":{"success":false,"errorCode":1001,"message":"Provided value for parameter: ip doesn't match requirements. Reason: count should not exceed 10"}}}},"paths":{"/bintu/token":{"post":{"tags":["Bintu"],"summary":"Create a token for the Bintu services","description":"bintu is the central streaming management of the nanoStream Cloud for your organisation. Here you have the possibility to manage your organisation-specific settings such as webhooks, users and streams. A created token can have the same rights as your `apikey` or less if the user associated is not a `nanoAdmin`. We therefore recommend using a short expiration (`exp`) to increase security and to relate token to users via the issuer (`iss`) field","operationId":"Create a token for the bintu services","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"exp":{"required":false,"$ref":"#/components/schemas/expBintu"},"nbf":{"required":false,"$ref":"#/components/schemas/nbfBintu"},"iss":{"required":false,"$ref":"#/components/schemas/iss"},"aud":{"required":false,"$ref":"#/components/schemas/aud"},"custom":{"required":false,"$ref":"#/components/schemas/custom"}}},"example":{"exp":1724832286,"nbf":1724745886,"iss":"1f3542f2-42ca-4c33-9f05-daedc7dfb44f"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200Token"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/MaxExpirationReached"},{"$ref":"#/components/schemas/TokenNeverValid"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_APIkey"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/bintu/token \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"exp\":\"1724832286\",\"nbf\":\"1724832286\",\"iss\":\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\"aud\":[\"bintu\",\"splay\",\"metrics\"],\"custom\":\"Token issued for service XXX\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/bintu/token\"\n\n\tpayload := strings.NewReader(\"{\\\"exp\\\":\\\"1724832286\\\",\\\"nbf\\\":\\\"1724832286\\\",\\\"iss\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"aud\\\":[\\\"bintu\\\",\\\"splay\\\",\\\"metrics\\\"],\\\"custom\\\":\\\"Token issued for service XXX\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/bintu/token\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"exp\\\":\\\"1724832286\\\",\\\"nbf\\\":\\\"1724832286\\\",\\\"iss\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"aud\\\":[\\\"bintu\\\",\\\"splay\\\",\\\"metrics\\\"],\\\"custom\\\":\\\"Token issued for service XXX\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"exp\": \"1724832286\",\n  \"nbf\": \"1724832286\",\n  \"iss\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\n  \"aud\": [\n    \"bintu\",\n    \"splay\",\n    \"metrics\"\n  ],\n  \"custom\": \"Token issued for service XXX\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/bintu/token\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/bintu/token\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"exp\": \"1724832286\",\n  \"nbf\": \"1724832286\",\n  \"iss\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\n  \"aud\": [\n    \"bintu\",\n    \"splay\",\n    \"metrics\"\n  ],\n  \"custom\": \"Token issued for service XXX\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"exp\":\"1724832286\",\"nbf\":\"1724832286\",\"iss\":\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\"aud\":[\"bintu\",\"splay\",\"metrics\"],\"custom\":\"Token issued for service XXX\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/bintu/token');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"exp\\\":\\\"1724832286\\\",\\\"nbf\\\":\\\"1724832286\\\",\\\"iss\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"aud\\\":[\\\"bintu\\\",\\\"splay\\\",\\\"metrics\\\"],\\\"custom\\\":\\\"Token issued for service XXX\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/bintu/token\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/bintu/token\"\n\npayload = {\n    \"exp\": \"1724832286\",\n    \"nbf\": \"1724832286\",\n    \"iss\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\n    \"aud\": [\"bintu\", \"splay\", \"metrics\"],\n    \"custom\": \"Token issued for service XXX\"\n}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/bintu/token\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"exp\\\":\\\"1724832286\\\",\\\"nbf\\\":\\\"1724832286\\\",\\\"iss\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"aud\\\":[\\\"bintu\\\",\\\"splay\\\",\\\"metrics\\\"],\\\"custom\\\":\\\"Token issued for service XXX\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\n  \"exp\": \"1724832286\",\n  \"nbf\": \"1724832286\",\n  \"iss\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\n  \"aud\": [\"bintu\", \"splay\", \"metrics\"],\n  \"custom\": \"Token issued for service XXX\"\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/bintu/token\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/bintu/token\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"exp\\\":\\\"1724832286\\\",\\\"nbf\\\":\\\"1724832286\\\",\\\"iss\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"aud\\\":[\\\"bintu\\\",\\\"splay\\\",\\\"metrics\\\"],\\\"custom\\\":\\\"Token issued for service XXX\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/bintu/token\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"exp\\\":\\\"1724832286\\\",\\\"nbf\\\":\\\"1724832286\\\",\\\"iss\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"aud\\\":[\\\"bintu\\\",\\\"splay\\\",\\\"metrics\\\"],\\\"custom\\\":\\\"Token issued for service XXX\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/bintu/token\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"exp\\\":\\\"1724832286\\\",\\\"nbf\\\":\\\"1724832286\\\",\\\"iss\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"aud\\\":[\\\"bintu\\\",\\\"splay\\\",\\\"metrics\\\"],\\\"custom\\\":\\\"Token issued for service XXX\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}},"/bintu/verify":{"post":{"tags":["Bintu"],"summary":"Validate a token for the Bintu service","description":"A token not only has the characteristic that it has a time-limited validity, but also that it can only be used by a specific service. This is achieved by the `aud` (audience) property, which is unique for each service. It is therefore not possible to use a token created for the webcaster to access another service such as Bintu.","operationId":"Validate a token for the bintu services","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"$ref":"#/components/schemas/token"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200TokenVerified"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_JWT"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/bintu/verify \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/bintu/verify\"\n\n\tpayload := strings.NewReader(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/bintu/verify\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/bintu/verify\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/bintu/verify\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/bintu/verify');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/bintu/verify\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/bintu/verify\"\n\npayload = {\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/bintu/verify\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/bintu/verify\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/bintu/verify\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/bintu/verify\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/bintu/verify\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}},"/nanomeet":{"post":{"tags":["NanoMeet"],"summary":"Create a token for the NanoMeet service","description":"NanoMeet allows you to meet securely within your organisation. Room names are strictly assigned to your organisation, so even if a third party chooses the same room name, they will not be able to join your meeting.","operationId":"Create a token for the nanoMeet service","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"exp":{"$ref":"#/components/schemas/exp"},"nbf":{"$ref":"#/components/schemas/nbf"},"roomname":{"$ref":"#/components/schemas/roomname"},"streamname":{"$ref":"#/components/schemas/streamname"},"moderator":{"$ref":"#/components/schemas/moderator"},"server":{"$ref":"#/components/schemas/server"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200Token"}}}},"400":{"description":"Bad Request","content":{"application/json":{"example":{"value":{"success":false,"errorCode":3003,"message":"Parameter required: streamname"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_APIkey"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/nanomeet \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"exp\":1635638400,\"nbf\":1635638400,\"roomname\":\"nanomeet_demo\",\"streamname\":\"abcde-fghij\",\"moderator\":true,\"server\":\"nanomeet-us.nanocosmos.de\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/nanomeet\"\n\n\tpayload := strings.NewReader(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"roomname\\\":\\\"nanomeet_demo\\\",\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"moderator\\\":true,\\\"server\\\":\\\"nanomeet-us.nanocosmos.de\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/nanomeet\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"roomname\\\":\\\"nanomeet_demo\\\",\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"moderator\\\":true,\\\"server\\\":\\\"nanomeet-us.nanocosmos.de\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"roomname\": \"nanomeet_demo\",\n  \"streamname\": \"abcde-fghij\",\n  \"moderator\": true,\n  \"server\": \"nanomeet-us.nanocosmos.de\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/nanomeet\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/nanomeet\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"roomname\": \"nanomeet_demo\",\n  \"streamname\": \"abcde-fghij\",\n  \"moderator\": true,\n  \"server\": \"nanomeet-us.nanocosmos.de\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"exp\":1635638400,\"nbf\":1635638400,\"roomname\":\"nanomeet_demo\",\"streamname\":\"abcde-fghij\",\"moderator\":true,\"server\":\"nanomeet-us.nanocosmos.de\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/nanomeet');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"roomname\\\":\\\"nanomeet_demo\\\",\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"moderator\\\":true,\\\"server\\\":\\\"nanomeet-us.nanocosmos.de\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/nanomeet\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/nanomeet\"\n\npayload = {\n    \"exp\": 1635638400,\n    \"nbf\": 1635638400,\n    \"roomname\": \"nanomeet_demo\",\n    \"streamname\": \"abcde-fghij\",\n    \"moderator\": True,\n    \"server\": \"nanomeet-us.nanocosmos.de\"\n}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/nanomeet\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"roomname\\\":\\\"nanomeet_demo\\\",\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"moderator\\\":true,\\\"server\\\":\\\"nanomeet-us.nanocosmos.de\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"roomname\": \"nanomeet_demo\",\n  \"streamname\": \"abcde-fghij\",\n  \"moderator\": true,\n  \"server\": \"nanomeet-us.nanocosmos.de\"\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/nanomeet\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/nanomeet\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"roomname\\\":\\\"nanomeet_demo\\\",\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"moderator\\\":true,\\\"server\\\":\\\"nanomeet-us.nanocosmos.de\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/nanomeet\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"roomname\\\":\\\"nanomeet_demo\\\",\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"moderator\\\":true,\\\"server\\\":\\\"nanomeet-us.nanocosmos.de\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/nanomeet\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"roomname\\\":\\\"nanomeet_demo\\\",\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"moderator\\\":true,\\\"server\\\":\\\"nanomeet-us.nanocosmos.de\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}},"/nanomeet/verify":{"post":{"tags":["NanoMeet"],"summary":"Validate a token for the NanoMeet service","description":"A token not only has the characteristic that it has a time-limited validity, but also that it can only be used by a specific service. This is achieved by the `aud` (audience) property, which is unique for each service. It is therefore not possible to use a token created for the webcaster to access another service such as Bintu.","operationId":"Validate a token for the nanoMeet service","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"$ref":"#/components/schemas/token"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200Token"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_JWT"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/nanomeet/verify \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/nanomeet/verify\"\n\n\tpayload := strings.NewReader(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/nanomeet/verify\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/nanomeet/verify\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/nanomeet/verify\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/nanomeet/verify');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/nanomeet/verify\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/nanomeet/verify\"\n\npayload = {\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/nanomeet/verify\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/nanomeet/verify\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/nanomeet/verify\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/nanomeet/verify\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/nanomeet/verify\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}},"/webcaster":{"post":{"tags":["Webcaster"],"summary":"Create a token for the Webcaster service","description":"By using JWT you can now omit the Bintu API key while using the Webcaster. Also, JWT will contain ingest information, so your customers won't see the ingest urls and ingest streamnames. The Webcaster API can now utilize JWT for signing in to the servers and for sharing ingest information.","operationId":"Create a token for the Webcaster service","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"exp":{"$ref":"#/components/schemas/exp"},"nbf":{"$ref":"#/components/schemas/nbf"},"streamname":{"$ref":"#/components/schemas/streamname"},"ingesturl":{"$ref":"#/components/schemas/ingesturl"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200Token"}}}},"400":{"description":"Bad Request","content":{}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_APIkey"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/webcaster \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"exp\":1635638400,\"nbf\":1635638400,\"streamname\":\"abcde-fghij\",\"ingesturl\":\"rtmp://bintu-stream.nanocosmos.de:1935/rec\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/webcaster\"\n\n\tpayload := strings.NewReader(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"ingesturl\\\":\\\"rtmp://bintu-stream.nanocosmos.de:1935/rec\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/webcaster\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"ingesturl\\\":\\\"rtmp://bintu-stream.nanocosmos.de:1935/rec\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"streamname\": \"abcde-fghij\",\n  \"ingesturl\": \"rtmp://bintu-stream.nanocosmos.de:1935/rec\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/webcaster\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/webcaster\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"streamname\": \"abcde-fghij\",\n  \"ingesturl\": \"rtmp://bintu-stream.nanocosmos.de:1935/rec\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"exp\":1635638400,\"nbf\":1635638400,\"streamname\":\"abcde-fghij\",\"ingesturl\":\"rtmp://bintu-stream.nanocosmos.de:1935/rec\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/webcaster');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"ingesturl\\\":\\\"rtmp://bintu-stream.nanocosmos.de:1935/rec\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/webcaster\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/webcaster\"\n\npayload = {\n    \"exp\": 1635638400,\n    \"nbf\": 1635638400,\n    \"streamname\": \"abcde-fghij\",\n    \"ingesturl\": \"rtmp://bintu-stream.nanocosmos.de:1935/rec\"\n}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/webcaster\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"ingesturl\\\":\\\"rtmp://bintu-stream.nanocosmos.de:1935/rec\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"streamname\": \"abcde-fghij\",\n  \"ingesturl\": \"rtmp://bintu-stream.nanocosmos.de:1935/rec\"\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/webcaster\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/webcaster\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"ingesturl\\\":\\\"rtmp://bintu-stream.nanocosmos.de:1935/rec\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/webcaster\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"ingesturl\\\":\\\"rtmp://bintu-stream.nanocosmos.de:1935/rec\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/webcaster\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"streamname\\\":\\\"abcde-fghij\\\",\\\"ingesturl\\\":\\\"rtmp://bintu-stream.nanocosmos.de:1935/rec\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}},"/webcaster/verify":{"post":{"tags":["Webcaster"],"summary":"Validate a token for the Webcaster service","description":"A token not only has the characteristic that it has a time-limited validity, but also that it can only be used by a specific service. This is achieved by the `aud` (audience) property, which is unique for each service. It is therefore not possible to use a token created for the webcaster to access another service such as Bintu.","operationId":"Validate a token for the Webcaster service","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"$ref":"#/components/schemas/token"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200Token"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_JWT"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/webcaster/verify \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/webcaster/verify\"\n\n\tpayload := strings.NewReader(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/webcaster/verify\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/webcaster/verify\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/webcaster/verify\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/webcaster/verify');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/webcaster/verify\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/webcaster/verify\"\n\npayload = {\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/webcaster/verify\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/webcaster/verify\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/webcaster/verify\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/webcaster/verify\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/webcaster/verify\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}},"/api/v1/splay":{"post":{"tags":["H5Live Playback"],"summary":"Create a token for the H5Live Playback service","description":"Create secure, time-limited tokens for H5Live Playback access. \n\n### Token scope restriction\n\nThere are 3 available token scopes you can use:\n- `streams` - allows you to pass an array of stream names for which the newly created token will be valid for\n- `groupid` - makes the token valid for the entire stream group\n- `orgawide` - makes the token valid for all streams from the organization (not recommended for production use)\n\n**Requirement:** Specify exactly one of: `streams`, `orgawide`, or `groupid`.\n\n### Revocable Tokens\nSet `revocable: true` to enable token invalidation before expiration.\n- **Use case:** Immediately block access if a token is compromised\n- **How it works:** [Call revoke endpoint](#operation/Revoke%20a%20token%20for%20the%20H5Live%20Playback%20service) to invalidate the token\n- **Limitation:** Maximum 24 hours expiration time\n- **Default:** `false` (non-revocable tokens can have up to 365 days expiration)\n\n### Force Disconnect\nSet `forceDisconnect: true` to automatically terminate active playback sessions when the token expires.\n- **Use case:** Time-limited content access where viewers must stop watching after a specific time\n- **How it works:** \n  1. Viewer starts watching with a force disconnect token\n  2. When token expires, their active playback session is immediately terminated\n  3. Viewer cannot continue watching even if they were already connected\n- **Default:** `false` (expired tokens block new connections but don't disconnect existing sessions)\n\n### IP/Domain Restrictions\n\nSet the `ip` parameter to restrict the token to one or more IPv4 addresses or IPv4 CIDR ranges. Provide either a single string or an array of entries:\n- A bare IPv4 address (e.g. `203.0.113.42`) matches that exact address\n- An IPv4 CIDR (e.g. `203.0.113.0/24`) matches any address within that network\n\nEntries are sanitized (whitespace trimmed, blanks dropped, duplicates removed) and validated; an invalid entry causes the request to fail with an error identifying its index in the array. Up to 10 entries are allowed. If sanitization leaves no entries (e.g. an empty array, or an array of only blank strings), the request is treated as if `ip` was omitted — no IP restriction is applied.\n\nSet the `domain` parameter to restrict the token to a specific domain.\n\n### User identifier\n\nSet the `user` parameter to include additional information about the user of the token.\n\n### Timestamps\n- Use Unix timestamps (seconds since epoch)\n- `exp` (expiration) must be in the future — sets when the token expires\n- `nbf` (not before) must be less than `exp` — sets when the token becomes valid\n\n### Token expiration rules\n- **Revocable tokens:** Maximum 24 hours\n- **Non-revocable tokens:** Maximum 365 days\n- **Default expiration:** 24 hours if not specified","operationId":"Create a token for the H5Live Playback service","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"exp":{"$ref":"#/components/schemas/exp"},"nbf":{"$ref":"#/components/schemas/nbf"},"groupid":{"$ref":"#/components/schemas/groupid"},"orgawide":{"$ref":"#/components/schemas/orgawide"},"streams":{"$ref":"#/components/schemas/streams"},"revocable":{"$ref":"#/components/schemas/revocable"},"forceDisconnect":{"$ref":"#/components/schemas/forceDisconnect"},"ip":{"$ref":"#/components/schemas/ip"},"domain":{"$ref":"#/components/schemas/domain"},"user":{"$ref":"#/components/schemas/user"}}},"examples":{"single-stream-revocable":{"summary":"Single stream with revocation enabled","value":{"streams":["8sKpm-x49nB"],"revocable":true,"exp":1738159400}},"single-stream-force-disconnect":{"summary":"Single stream with force disconnect","value":{"streams":["8sKpm-x49nB"],"forceDisconnect":true,"exp":1738159400}},"single-stream-both-features":{"summary":"Single stream with revocation and force disconnect","value":{"streams":["8sKpm-x49nB"],"revocable":true,"forceDisconnect":true,"exp":1738159400}},"multiple-streams-revocable":{"summary":"Multiple streams with revocation enabled","value":{"streams":["8sKpm-x49nB","8sKpm-y50nC"],"revocable":true}},"multiple-streams-force-disconnect":{"summary":"Multiple streams with force disconnect","value":{"streams":["8sKpm-x49nB","8sKpm-y50nC"],"forceDisconnect":true,"exp":1738159400}},"orgawide-revocable":{"summary":"Organization-wide with revocation enabled","value":{"orgawide":true,"revocable":true,"exp":1738159400}},"orgawide-force-disconnect":{"summary":"Organization-wide with force disconnect","value":{"orgawide":true,"forceDisconnect":true,"exp":1738159400}},"ip-restricted":{"summary":"Token restricted to a specific IP address","value":{"streams":["8sKpm-x49nB"],"ip":"203.0.113.42","exp":1738159400}},"ip-array-restricted":{"summary":"Token restricted to multiple IP addresses/CIDR ranges","value":{"streams":["8sKpm-x49nB"],"ip":["203.0.113.42","198.51.100.0/24"],"exp":1738159400}},"domain-restricted":{"summary":"Token restricted to a specific domain","value":{"streams":["8sKpm-x49nB"],"domain":"example.com","exp":1738159400}},"basic-token":{"summary":"Basic token (no special features)","value":{"streams":["8sKpm-x49nB"],"exp":1738159400}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200Token"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SPlayTokenNeverValid"},{"$ref":"#/components/schemas/ExpTooFarInFuture"},{"$ref":"#/components/schemas/ExpInPast"},{"$ref":"#/components/schemas/NbfTooFarInFuture"},{"$ref":"#/components/schemas/NbfInPast"},{"$ref":"#/components/schemas/InvalidIpEntry"},{"$ref":"#/components/schemas/TooManyIpEntries"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_APIkey"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/api/v1/splay \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"exp\":1635638400,\"nbf\":1635638400,\"groupid\":\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\"orgawide\":true,\"streams\":[\"S9I9O-u3Bjd\",\"S9I9O-0oUs7\",\"S9I9O-9uzxs\"],\"revocable\":true,\"forceDisconnect\":true,\"ip\":\"203.0.113.42\",\"domain\":\"example.com\",\"user\":\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/api/v1/splay\"\n\n\tpayload := strings.NewReader(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"groupid\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"orgawide\\\":true,\\\"streams\\\":[\\\"S9I9O-u3Bjd\\\",\\\"S9I9O-0oUs7\\\",\\\"S9I9O-9uzxs\\\"],\\\"revocable\\\":true,\\\"forceDisconnect\\\":true,\\\"ip\\\":\\\"203.0.113.42\\\",\\\"domain\\\":\\\"example.com\\\",\\\"user\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/api/v1/splay\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"groupid\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"orgawide\\\":true,\\\"streams\\\":[\\\"S9I9O-u3Bjd\\\",\\\"S9I9O-0oUs7\\\",\\\"S9I9O-9uzxs\\\"],\\\"revocable\\\":true,\\\"forceDisconnect\\\":true,\\\"ip\\\":\\\"203.0.113.42\\\",\\\"domain\\\":\\\"example.com\\\",\\\"user\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"groupid\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\n  \"orgawide\": true,\n  \"streams\": [\n    \"S9I9O-u3Bjd\",\n    \"S9I9O-0oUs7\",\n    \"S9I9O-9uzxs\"\n  ],\n  \"revocable\": true,\n  \"forceDisconnect\": true,\n  \"ip\": \"203.0.113.42\",\n  \"domain\": \"example.com\",\n  \"user\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/api/v1/splay\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/api/v1/splay\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"groupid\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\n  \"orgawide\": true,\n  \"streams\": [\n    \"S9I9O-u3Bjd\",\n    \"S9I9O-0oUs7\",\n    \"S9I9O-9uzxs\"\n  ],\n  \"revocable\": true,\n  \"forceDisconnect\": true,\n  \"ip\": \"203.0.113.42\",\n  \"domain\": \"example.com\",\n  \"user\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"exp\":1635638400,\"nbf\":1635638400,\"groupid\":\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\"orgawide\":true,\"streams\":[\"S9I9O-u3Bjd\",\"S9I9O-0oUs7\",\"S9I9O-9uzxs\"],\"revocable\":true,\"forceDisconnect\":true,\"ip\":\"203.0.113.42\",\"domain\":\"example.com\",\"user\":\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/api/v1/splay');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"groupid\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"orgawide\\\":true,\\\"streams\\\":[\\\"S9I9O-u3Bjd\\\",\\\"S9I9O-0oUs7\\\",\\\"S9I9O-9uzxs\\\"],\\\"revocable\\\":true,\\\"forceDisconnect\\\":true,\\\"ip\\\":\\\"203.0.113.42\\\",\\\"domain\\\":\\\"example.com\\\",\\\"user\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/api/v1/splay\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/api/v1/splay\"\n\npayload = {\n    \"exp\": 1635638400,\n    \"nbf\": 1635638400,\n    \"groupid\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\n    \"orgawide\": True,\n    \"streams\": [\"S9I9O-u3Bjd\", \"S9I9O-0oUs7\", \"S9I9O-9uzxs\"],\n    \"revocable\": True,\n    \"forceDisconnect\": True,\n    \"ip\": \"203.0.113.42\",\n    \"domain\": \"example.com\",\n    \"user\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\"\n}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/api/v1/splay\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"groupid\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"orgawide\\\":true,\\\"streams\\\":[\\\"S9I9O-u3Bjd\\\",\\\"S9I9O-0oUs7\\\",\\\"S9I9O-9uzxs\\\"],\\\"revocable\\\":true,\\\"forceDisconnect\\\":true,\\\"ip\\\":\\\"203.0.113.42\\\",\\\"domain\\\":\\\"example.com\\\",\\\"user\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\n  \"exp\": 1635638400,\n  \"nbf\": 1635638400,\n  \"groupid\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\",\n  \"orgawide\": true,\n  \"streams\": [\"S9I9O-u3Bjd\", \"S9I9O-0oUs7\", \"S9I9O-9uzxs\"],\n  \"revocable\": true,\n  \"forceDisconnect\": true,\n  \"ip\": \"203.0.113.42\",\n  \"domain\": \"example.com\",\n  \"user\": \"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\"\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/api/v1/splay\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/api/v1/splay\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"groupid\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"orgawide\\\":true,\\\"streams\\\":[\\\"S9I9O-u3Bjd\\\",\\\"S9I9O-0oUs7\\\",\\\"S9I9O-9uzxs\\\"],\\\"revocable\\\":true,\\\"forceDisconnect\\\":true,\\\"ip\\\":\\\"203.0.113.42\\\",\\\"domain\\\":\\\"example.com\\\",\\\"user\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/api/v1/splay\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"groupid\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"orgawide\\\":true,\\\"streams\\\":[\\\"S9I9O-u3Bjd\\\",\\\"S9I9O-0oUs7\\\",\\\"S9I9O-9uzxs\\\"],\\\"revocable\\\":true,\\\"forceDisconnect\\\":true,\\\"ip\\\":\\\"203.0.113.42\\\",\\\"domain\\\":\\\"example.com\\\",\\\"user\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/api/v1/splay\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"exp\\\":1635638400,\\\"nbf\\\":1635638400,\\\"groupid\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\",\\\"orgawide\\\":true,\\\"streams\\\":[\\\"S9I9O-u3Bjd\\\",\\\"S9I9O-0oUs7\\\",\\\"S9I9O-9uzxs\\\"],\\\"revocable\\\":true,\\\"forceDisconnect\\\":true,\\\"ip\\\":\\\"203.0.113.42\\\",\\\"domain\\\":\\\"example.com\\\",\\\"user\\\":\\\"1f3542f2-42ca-4c33-9f05-daedc7dfb44f\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}},"/api/v1/splay/verify":{"post":{"tags":["H5Live Playback"],"summary":"Validate a token for the H5Live Playback service","description":"A token not only has the characteristic that it has a time-limited validity, but also that it can only be used by a specific service. This is achieved by the `aud` (audience) property, which is unique for each service. It is therefore not possible to use a token created for the webcaster to access another service such as Bintu.","operationId":"Validate a token for the H5Live Playback service","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"$ref":"#/components/schemas/token"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200Token"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_JWT"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/api/v1/splay/verify \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/api/v1/splay/verify\"\n\n\tpayload := strings.NewReader(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/api/v1/splay/verify\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/api/v1/splay/verify\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/api/v1/splay/verify\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/api/v1/splay/verify');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/api/v1/splay/verify\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/api/v1/splay/verify\"\n\npayload = {\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/api/v1/splay/verify\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/api/v1/splay/verify\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/api/v1/splay/verify\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/api/v1/splay/verify\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/api/v1/splay/verify\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}},"/api/v1/splay/revoke":{"post":{"tags":["H5Live Playback"],"summary":"Revoke a playback token","description":"Immediately invalidate a revocable token, blocking all future access attempts. Once revoked, the token cannot be used to start new playback sessions and will be disconnected from a current session.\n\n### What happens when you revoke a token\n- The token is immediately blocked across all services\n- New playback attempts with this token will be rejected\n- Any currently running sessions using this token will be automatically disconnected.\n\n### Requirements\n- Token must have been created with `revocable: true` (returns error code 2011 if not revocable)\n- Token must belong to your organization (returns error code 2012 if from different org)\n- Authenticate with `x-bintu-apikey` or `x-bintu-token` header\n\n### Use Cases\n- Block access immediately if a token is compromised\n- Revoke access when a user's subscription ends\n- Invalidate temporary access tokens after specific events","operationId":"Revoke a token for the H5Live Playback service","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"$ref":"#/components/schemas/token"}}},"example":{"token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."}}}},"responses":{"204":{"description":"No Content - Token successfully revoked"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TokenNotRevocable"},{"$ref":"#/components/schemas/MalformedJWT"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized_APIkey"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenWrongOrganization"}}}}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://token.nanostream.cloud/api/v1/splay/revoke \\\n  --header 'X-BINTU-APIKEY: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}'"},{"lang":"Go + Native","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://token.nanostream.cloud/api/v1/splay/revoke\"\n\n\tpayload := strings.NewReader(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"},{"lang":"Java + Unirest","source":"HttpResponse<String> response = Unirest.post(\"https://token.nanostream.cloud/api/v1/splay/revoke\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\")\n  .body(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n  .asString();"},{"lang":"Javascript + Xhr","source":"const data = JSON.stringify({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://token.nanostream.cloud/api/v1/splay/revoke\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\n\nxhr.send(data);"},{"lang":"Node + Unirest","source":"const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://token.nanostream.cloud/api/v1/splay/revoke\");\n\nreq.headers({\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n});\n\nreq.type(\"json\");\nreq.send({\n  \"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"\n});\n\nreq.end(function (res) {\n  if (res.error) throw new Error(res.error);\n\n  console.log(res.body);\n});\n"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}');\n\n$request->setRequestUrl('https://token.nanostream.cloud/api/v1/splay/revoke');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'X-BINTU-APIKEY' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"token.nanostream.cloud\")\n\npayload = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'X-BINTU-APIKEY': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/api/v1/splay/revoke\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Python + Requests","source":"import requests\n\nurl = \"https://token.nanostream.cloud/api/v1/splay/revoke\"\n\npayload = {\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"},{"lang":"Ruby + Native","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://token.nanostream.cloud/api/v1/splay/revoke\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"X-BINTU-APIKEY\"] = 'REPLACE_KEY_VALUE'\nrequest.body = \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"lang":"Swift + Nsurlsession","source":"import Foundation\n\nlet headers = [\n  \"content-type\": \"application/json\",\n  \"X-BINTU-APIKEY\": \"REPLACE_KEY_VALUE\"\n]\nlet parameters = [\"token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\"] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://token.nanostream.cloud/api/v1/splay/revoke\")! as URL,\n                                        cachePolicy: .useProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    print(error)\n  } else {\n    let httpResponse = response as? HTTPURLResponse\n    print(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"lang":"C + Libcurl","source":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://token.nanostream.cloud/api/v1/splay/revoke\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application/json\");\nheaders = curl_slist_append(headers, \"X-BINTU-APIKEY: REPLACE_KEY_VALUE\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"lang":"Csharp + Restsharp","source":"var client = new RestClient(\"https://token.nanostream.cloud/api/v1/splay/revoke\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\");\nrequest.AddParameter(\"application/json\", \"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"lang":"Csharp + Httpclient","source":"var client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n    Method = HttpMethod.Post,\n    RequestUri = new Uri(\"https://token.nanostream.cloud/api/v1/splay/revoke\"),\n    Headers =\n    {\n        { \"X-BINTU-APIKEY\", \"REPLACE_KEY_VALUE\" },\n    },\n    Content = new StringContent(\"{\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im5hbm9jb3Ntb3MifQ...\\\"}\")\n    {\n        Headers =\n        {\n            ContentType = new MediaTypeHeaderValue(\"application/json\")\n        }\n    }\n};\nusing (var response = await client.SendAsync(request))\n{\n    response.EnsureSuccessStatusCode();\n    var body = await response.Content.ReadAsStringAsync();\n    Console.WriteLine(body);\n}"}]}}}}
