Forming a request
How you send requests to the Streaming Writer API will vary depending on the client or language you’re using. But the API still has behavior and expectations that is common across all clients.
The examples in this section show how to use the popular
curl command line tool.
Before you begin
Sign up on the Quix Portal
Read about Authenticating with the Streaming Writer API
The Streaming Writer API is available on a per-workspace basis, so the subdomain is based on a combination of your organization and workspace names. See the Swagger documentation to find out how to get the exact hostname required. It will be in this format:
So your final endpoint URL will look something like:
Endpoints in this API use the
PUT methods. Ensure your HTTP
client sends the correct request method.
curl, you can specify the request method with the
<POST|PUT> flag, for example:
For most methods, you’ll need to send a JSON object containing supported parameters. You’ll also need to set the appropriate content type for the payload you’re sending:
You must specify the content type of your payload. Failing to
include this header will result in a
415 UNSUPPORTED MEDIA TYPE
You can send data using the
-d. This should be followed by
either a string of JSON data, or a string starting with the @ symbol,
followed by a filename containing the JSON data.
-d will send a
POST request, so
-X POST becomes unnecessary.
Complete curl example
You should structure most of your requests to the API around this pattern: