Batch Rewards
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json \
--header 'Content-Type: application/json' \
--data '
{
"rewards": [
{
"profile_id": "<string>",
"profile_id_handle": "<string>",
"timezone": "<string>",
"value_initial": 123,
"value_remaining": 123,
"expires_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"reward_definition_id": 123,
"reward_definition_handle": "<string>",
"meta": [
"<string>"
],
"external_id": "<string>"
}
],
"import_job_id": "<string>"
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json"
payload = {
"rewards": [
{
"profile_id": "<string>",
"profile_id_handle": "<string>",
"timezone": "<string>",
"value_initial": 123,
"value_remaining": 123,
"expires_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"reward_definition_id": 123,
"reward_definition_handle": "<string>",
"meta": ["<string>"],
"external_id": "<string>"
}
],
"import_job_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
rewards: [
{
profile_id: '<string>',
profile_id_handle: '<string>',
timezone: '<string>',
value_initial: 123,
value_remaining: 123,
expires_at: '2023-11-07T05:31:56Z',
issued_at: '2023-11-07T05:31:56Z',
reward_definition_id: 123,
reward_definition_handle: '<string>',
meta: ['<string>'],
external_id: '<string>'
}
],
import_job_id: '<string>'
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rewards' => [
[
'profile_id' => '<string>',
'profile_id_handle' => '<string>',
'timezone' => '<string>',
'value_initial' => 123,
'value_remaining' => 123,
'expires_at' => '2023-11-07T05:31:56Z',
'issued_at' => '2023-11-07T05:31:56Z',
'reward_definition_id' => 123,
'reward_definition_handle' => '<string>',
'meta' => [
'<string>'
],
'external_id' => '<string>'
]
],
'import_job_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json"
payload := strings.NewReader("{\n \"rewards\": [\n {\n \"profile_id\": \"<string>\",\n \"profile_id_handle\": \"<string>\",\n \"timezone\": \"<string>\",\n \"value_initial\": 123,\n \"value_remaining\": 123,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"reward_definition_id\": 123,\n \"reward_definition_handle\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"external_id\": \"<string>\"\n }\n ],\n \"import_job_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json")
.header("Content-Type", "application/json")
.body("{\n \"rewards\": [\n {\n \"profile_id\": \"<string>\",\n \"profile_id_handle\": \"<string>\",\n \"timezone\": \"<string>\",\n \"value_initial\": 123,\n \"value_remaining\": 123,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"reward_definition_id\": 123,\n \"reward_definition_handle\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"external_id\": \"<string>\"\n }\n ],\n \"import_job_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"rewards\": [\n {\n \"profile_id\": \"<string>\",\n \"profile_id_handle\": \"<string>\",\n \"timezone\": \"<string>\",\n \"value_initial\": 123,\n \"value_remaining\": 123,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"reward_definition_id\": 123,\n \"reward_definition_handle\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"external_id\": \"<string>\"\n }\n ],\n \"import_job_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"batch_id": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Reward
Batch Rewards
A POST to the /rewards/batch.json endpoint allows your application to process rewards in batch.
POST
/
v3
/
rewards
/
batch.json
Batch Rewards
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json \
--header 'Content-Type: application/json' \
--data '
{
"rewards": [
{
"profile_id": "<string>",
"profile_id_handle": "<string>",
"timezone": "<string>",
"value_initial": 123,
"value_remaining": 123,
"expires_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"reward_definition_id": 123,
"reward_definition_handle": "<string>",
"meta": [
"<string>"
],
"external_id": "<string>"
}
],
"import_job_id": "<string>"
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json"
payload = {
"rewards": [
{
"profile_id": "<string>",
"profile_id_handle": "<string>",
"timezone": "<string>",
"value_initial": 123,
"value_remaining": 123,
"expires_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"reward_definition_id": 123,
"reward_definition_handle": "<string>",
"meta": ["<string>"],
"external_id": "<string>"
}
],
"import_job_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
rewards: [
{
profile_id: '<string>',
profile_id_handle: '<string>',
timezone: '<string>',
value_initial: 123,
value_remaining: 123,
expires_at: '2023-11-07T05:31:56Z',
issued_at: '2023-11-07T05:31:56Z',
reward_definition_id: 123,
reward_definition_handle: '<string>',
meta: ['<string>'],
external_id: '<string>'
}
],
import_job_id: '<string>'
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rewards' => [
[
'profile_id' => '<string>',
'profile_id_handle' => '<string>',
'timezone' => '<string>',
'value_initial' => 123,
'value_remaining' => 123,
'expires_at' => '2023-11-07T05:31:56Z',
'issued_at' => '2023-11-07T05:31:56Z',
'reward_definition_id' => 123,
'reward_definition_handle' => '<string>',
'meta' => [
'<string>'
],
'external_id' => '<string>'
]
],
'import_job_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json"
payload := strings.NewReader("{\n \"rewards\": [\n {\n \"profile_id\": \"<string>\",\n \"profile_id_handle\": \"<string>\",\n \"timezone\": \"<string>\",\n \"value_initial\": 123,\n \"value_remaining\": 123,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"reward_definition_id\": 123,\n \"reward_definition_handle\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"external_id\": \"<string>\"\n }\n ],\n \"import_job_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json")
.header("Content-Type", "application/json")
.body("{\n \"rewards\": [\n {\n \"profile_id\": \"<string>\",\n \"profile_id_handle\": \"<string>\",\n \"timezone\": \"<string>\",\n \"value_initial\": 123,\n \"value_remaining\": 123,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"reward_definition_id\": 123,\n \"reward_definition_handle\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"external_id\": \"<string>\"\n }\n ],\n \"import_job_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/rewards/batch.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"rewards\": [\n {\n \"profile_id\": \"<string>\",\n \"profile_id_handle\": \"<string>\",\n \"timezone\": \"<string>\",\n \"value_initial\": 123,\n \"value_remaining\": 123,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"reward_definition_id\": 123,\n \"reward_definition_handle\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"external_id\": \"<string>\"\n }\n ],\n \"import_job_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"batch_id": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}⌘I