Fetch active currency sale for user
Definition
This API endpoint allows you to fetch the active currency sale for a given user in real time.
Request
GET https://api.inbrain.ai/panelist-api/v1/{userId}/active-currency-sale
Headers
Header | Description | Required |
---|---|---|
X-InBrain-Api-Key | Authentication API Key | true |
Parameters
Endpoint accepts a user id route parameter and client id query string parameter on the request link.
Root parameters
Parameter | Description | Required |
---|---|---|
userId | Unique user identifier | true |
clientId | Integration client id | true |
Examples
- cURL
- C#
- Node.js
curl \
--request GET 'https://api.inbrain.ai/panelist-api/v1/{userId}/active-currency-sale?clientId=INTEGRATION_CLIENT_ID_HERE' \
--header 'X-InBrain-Api-Key: YOUR_API_KEY_HERE'
using System.Net.Http;
using System.Threading.Tasks;
var requestUrl = "https://api.inbrain.ai/panelist-api/v1/{userId}/active-currency-sale?clientId=INTEGRATION_CLIENT_ID_HERE";
using (var httpClient = new HttpClient())
{
var requestMessage = new HttpRequestMessage(HttpMethod.Get, requestUrl);
requestMessage.Headers.Add("X-InBrain-Api-Key", "YOUR_API_KEY_HERE");
var response = await httpClient.SendAsync(requestMessage);
// process the response
}
const https = require('https');
const requestUrl = 'https://api.inbrain.ai/panelist-api/v1/{userId}/active-currency-sale?clientId=YOUR_CLIENT_ID_HERE';
const options = {
headers: {
'X-InBrain-Api-Key': 'YOUR_API_KEY_HERE'
}
};
https.get(requestUrl, options, (response) => {
let body = '';
response.on('data', (chunk) => {
body += chunk;
});
response.on('end', () => {
const surveysResponse = JSON.parse(body);
// process the response
});
}).on('error', (error) => {
console.error(error);
});
Response
Response codes
Code | Description | Reason |
---|---|---|
200 | Success | |
400 | Bad Request | Some of the request parameters are missing or invalid |
401 | Unauthorized | Invalid API Key |
404 | NotFound | User not found |
429 | Too Many Requests | Too many requests in a given amount of time |
500 | Internal Server Error | Server error occured while processing the request |
Success model
Successful response is a JSON object with the properties given below.
Property | Type | Description | Required |
---|---|---|---|
externalId | string | External id of the sale | true |
endOn | date | End date of the sale | true |
multiplier | decimal | Sale multiplier | true |
description | string | Description of the sale | false |
lockedUntil | date | Date until the currency sale is locked read more | false |
Error model
Error response is a JSON object with the properties given below.
Property | Type | Description | Required |
---|---|---|---|
code | string | API error code | true |
description | string | API error description | true |
messages | string[] | Error messages providing further error details | false |
Examples
- Success (200)
- Bad Request (400)
- Internal Server Error (500)
{
"externalId": "test",
"endOn": "2023-09-25T09:15:20.8835755Z",
"multiplier": 3.00,
"description": "Test Sale",
"lockedUntil": "2023-08-09T12:10:20.8835755"
}
{
"code": "C1001",
"description": "One or more validation errors occurred"
}
{
"code": "C1148",
"description": "Internal server error"
}