getMultiCodeCouponCodes
Retrieves the generated coupon codes for a multi-code coupon given its media code.
The media code is the code attribute of the Media
/couponcodes/{couponId}/{mediaCode}
Usage and SDK Samples
curl -X GET\
\
\
-H "Accept: application/json"\
"http://localhost:9001/couponwebservices/couponcodes/{couponId}/{mediaCode}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CouponCodesApi;
import java.io.File;
import java.util.*;
public class CouponCodesApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2_Password
OAuth oauth2_Password = (OAuth) defaultClient.getAuthentication("oauth2_Password");
oauth2_Password.setAccessToken("YOUR ACCESS TOKEN");
// Configure OAuth2 access token for authorization: oauth2_client_credentials
OAuth oauth2_client_credentials = (OAuth) defaultClient.getAuthentication("oauth2_client_credentials");
oauth2_client_credentials.setAccessToken("YOUR ACCESS TOKEN");
CouponCodesApi apiInstance = new CouponCodesApi();
String couponId = couponId_example; // String | the id of the multicode coupon
String mediaCode = mediaCode_example; // String | the code of the generated codes media
try {
byte[] result = apiInstance.getMultiCodeCouponCodes(couponId, mediaCode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CouponCodesApi#getMultiCodeCouponCodes");
e.printStackTrace();
}
}
}
import io.swagger.client.api.CouponCodesApi;
public class CouponCodesApiExample {
public static void main(String[] args) {
CouponCodesApi apiInstance = new CouponCodesApi();
String couponId = couponId_example; // String | the id of the multicode coupon
String mediaCode = mediaCode_example; // String | the code of the generated codes media
try {
byte[] result = apiInstance.getMultiCodeCouponCodes(couponId, mediaCode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CouponCodesApi#getMultiCodeCouponCodes");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: oauth2_Password)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Configure OAuth2 access token for authorization: (authentication scheme: oauth2_client_credentials)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
String *couponId = couponId_example; // the id of the multicode coupon
String *mediaCode = mediaCode_example; // the code of the generated codes media
CouponCodesApi *apiInstance = [[CouponCodesApi alloc] init];
// Retrieves the generated coupon codes for a multi-code coupon given its media code.
[apiInstance getMultiCodeCouponCodesWith:couponId
mediaCode:mediaCode
completionHandler: ^(byte[] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var CouponWebservices = require('coupon_webservices');
var defaultClient = CouponWebservices.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2_Password
var oauth2_Password = defaultClient.authentications['oauth2_Password'];
oauth2_Password.accessToken = "YOUR ACCESS TOKEN"
// Configure OAuth2 access token for authorization: oauth2_client_credentials
var oauth2_client_credentials = defaultClient.authentications['oauth2_client_credentials'];
oauth2_client_credentials.accessToken = "YOUR ACCESS TOKEN"
var api = new CouponWebservices.CouponCodesApi()
var couponId = couponId_example; // {{String}} the id of the multicode coupon
var mediaCode = mediaCode_example; // {{String}} the code of the generated codes media
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getMultiCodeCouponCodes(couponId, mediaCode, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getMultiCodeCouponCodesExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2_Password
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Configure OAuth2 access token for authorization: oauth2_client_credentials
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new CouponCodesApi();
var couponId = couponId_example; // String | the id of the multicode coupon
var mediaCode = mediaCode_example; // String | the code of the generated codes media
try
{
// Retrieves the generated coupon codes for a multi-code coupon given its media code.
byte[] result = apiInstance.getMultiCodeCouponCodes(couponId, mediaCode);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CouponCodesApi.getMultiCodeCouponCodes: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2_Password
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure OAuth2 access token for authorization: oauth2_client_credentials
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new Swagger\Client\ApiCouponCodesApi();
$couponId = couponId_example; // String | the id of the multicode coupon
$mediaCode = mediaCode_example; // String | the code of the generated codes media
try {
$result = $api_instance->getMultiCodeCouponCodes($couponId, $mediaCode);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponCodesApi->getMultiCodeCouponCodes: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CouponCodesApi;
# Configure OAuth2 access token for authorization: oauth2_Password
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Configure OAuth2 access token for authorization: oauth2_client_credentials
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::CouponCodesApi->new();
my $couponId = couponId_example; # String | the id of the multicode coupon
my $mediaCode = mediaCode_example; # String | the code of the generated codes media
eval {
my $result = $api_instance->getMultiCodeCouponCodes(couponId => $couponId, mediaCode => $mediaCode);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CouponCodesApi->getMultiCodeCouponCodes: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: oauth2_Password
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Configure OAuth2 access token for authorization: oauth2_client_credentials
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = swagger_client.CouponCodesApi()
couponId = couponId_example # String | the id of the multicode coupon
mediaCode = mediaCode_example # String | the code of the generated codes media
try:
# Retrieves the generated coupon codes for a multi-code coupon given its media code.
api_response = api_instance.get_multi_code_coupon_codes(couponId, mediaCode)
pprint(api_response)
except ApiException as e:
print("Exception when calling CouponCodesApi->getMultiCodeCouponCodes: %s\n" % e)
Parameters
| Name | Description |
|---|---|
| couponId* |
String
the id of the multicode coupon
Required
|
| mediaCode* |
String
the code of the generated codes media
Required
|