getRewards
List available rewards
/campaigns/{id}/rewards
Usage and SDK Samples
curl -X GET \
\
-H "Accept: application/json" \
"https://mxp-public-sn-app-api.dev.icadsistemi.com/v1/campaigns/{id}/rewards"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CampaignsApi;
import java.io.File;
import java.util.*;
public class CampaignsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: Cognito
OAuth Cognito = (OAuth) defaultClient.getAuthentication("Cognito");
Cognito.setAccessToken("YOUR ACCESS TOKEN");
// Create an instance of the API class
CampaignsApi apiInstance = new CampaignsApi();
String id = id_example; // String | Campaign ID
Integer supplierId = 56; // Integer |
try {
AvailableRewards result = apiInstance.getRewards(id, supplierId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignsApi#getRewards");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String id = new String(); // String | Campaign ID
final Integer supplierId = new Integer(); // Integer |
try {
final result = await api_instance.getRewards(id, supplierId);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->getRewards: $e\n');
}
import org.openapitools.client.api.CampaignsApi;
public class CampaignsApiExample {
public static void main(String[] args) {
CampaignsApi apiInstance = new CampaignsApi();
String id = id_example; // String | Campaign ID
Integer supplierId = 56; // Integer |
try {
AvailableRewards result = apiInstance.getRewards(id, supplierId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignsApi#getRewards");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: Cognito)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Create an instance of the API class
CampaignsApi *apiInstance = [[CampaignsApi alloc] init];
String *id = id_example; // Campaign ID (default to null)
Integer *supplierId = 56; // (default to null)
// List available rewards
[apiInstance getRewardsWith:id
supplierId:supplierId
completionHandler: ^(AvailableRewards output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SelfnetApp = require('selfnet_app');
var defaultClient = SelfnetApp.ApiClient.instance;
// Configure OAuth2 access token for authorization: Cognito
var Cognito = defaultClient.authentications['Cognito'];
Cognito.accessToken = "YOUR ACCESS TOKEN";
// Create an instance of the API class
var api = new SelfnetApp.CampaignsApi()
var id = id_example; // {String} Campaign ID
var supplierId = 56; // {Integer}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getRewards(id, supplierId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class getRewardsExample
{
public void main()
{
// Configure OAuth2 access token for authorization: Cognito
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Create an instance of the API class
var apiInstance = new CampaignsApi();
var id = id_example; // String | Campaign ID (default to null)
var supplierId = 56; // Integer | (default to null)
try {
// List available rewards
AvailableRewards result = apiInstance.getRewards(id, supplierId);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling CampaignsApi.getRewards: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: Cognito
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CampaignsApi();
$id = id_example; // String | Campaign ID
$supplierId = 56; // Integer |
try {
$result = $api_instance->getRewards($id, $supplierId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CampaignsApi->getRewards: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CampaignsApi;
# Configure OAuth2 access token for authorization: Cognito
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CampaignsApi->new();
my $id = id_example; # String | Campaign ID
my $supplierId = 56; # Integer |
eval {
my $result = $api_instance->getRewards(id => $id, supplierId => $supplierId);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CampaignsApi->getRewards: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: Cognito
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Create an instance of the API class
api_instance = openapi_client.CampaignsApi()
id = id_example # String | Campaign ID (default to null)
supplierId = 56 # Integer | (default to null)
try:
# List available rewards
api_response = api_instance.get_rewards(id, supplierId)
pprint(api_response)
except ApiException as e:
print("Exception when calling CampaignsApi->getRewards: %s\n" % e)
extern crate CampaignsApi;
pub fn main() {
let id = id_example; // String
let supplierId = 56; // Integer
let mut context = CampaignsApi::Context::default();
let result = client.getRewards(id, supplierId, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
id* |
String
Campaign ID
Required
|
Name | Description |
---|---|
supplier-id* |
Integer
Required
|