createEventsSubscription
Create events subscription
Create a subscription for one or more Amazon Yojaka events. A single connector application can have only one subscription per seller. This single subscription can be used for receiving multiple events.
/events/subscriptions
Usage and SDK Samples
curl -X POST "https://api.sandbox.dub.yojaka.xp.sellers.a2z.com/v1/events/subscriptions"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.EventSubscriptionManagementApi;
import java.io.File;
import java.util.*;
public class EventSubscriptionManagementApiExample {
public static void main(String[] args) {
EventSubscriptionManagementApi apiInstance = new EventSubscriptionManagementApi();
EventsSubscription body = ; // EventsSubscription | The request body containing the details of the destination AWS EventBridge event bus and the events to subscribe to.
String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
try {
apiInstance.createEventsSubscription(body, xAmzAccessToken);
} catch (ApiException e) {
System.err.println("Exception when calling EventSubscriptionManagementApi#createEventsSubscription");
e.printStackTrace();
}
}
}
import io.swagger.client.api.EventSubscriptionManagementApi;
public class EventSubscriptionManagementApiExample {
public static void main(String[] args) {
EventSubscriptionManagementApi apiInstance = new EventSubscriptionManagementApi();
EventsSubscription body = ; // EventsSubscription | The request body containing the details of the destination AWS EventBridge event bus and the events to subscribe to.
String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
try {
apiInstance.createEventsSubscription(body, xAmzAccessToken);
} catch (ApiException e) {
System.err.println("Exception when calling EventSubscriptionManagementApi#createEventsSubscription");
e.printStackTrace();
}
}
}
EventsSubscription *body = ; // The request body containing the details of the destination AWS EventBridge event bus and the events to subscribe to.
String *xAmzAccessToken = xAmzAccessToken_example; // The LWA access token for authorizing the request
EventSubscriptionManagementApi *apiInstance = [[EventSubscriptionManagementApi alloc] init];
// Create events subscription
[apiInstance createEventsSubscriptionWith:body
xAmzAccessToken:xAmzAccessToken
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var AmazonYojakaApiEventNotificationsModel = require('amazon_yojaka_api_event_notifications_model');
var api = new AmazonYojakaApiEventNotificationsModel.EventSubscriptionManagementApi()
var body = ; // {{EventsSubscription}} The request body containing the details of the destination AWS EventBridge event bus and the events to subscribe to.
var xAmzAccessToken = xAmzAccessToken_example; // {{String}} The LWA access token for authorizing the request
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.createEventsSubscription(bodyxAmzAccessToken, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createEventsSubscriptionExample
{
public void main()
{
var apiInstance = new EventSubscriptionManagementApi();
var body = new EventsSubscription(); // EventsSubscription | The request body containing the details of the destination AWS EventBridge event bus and the events to subscribe to.
var xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
try
{
// Create events subscription
apiInstance.createEventsSubscription(body, xAmzAccessToken);
}
catch (Exception e)
{
Debug.Print("Exception when calling EventSubscriptionManagementApi.createEventsSubscription: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiEventSubscriptionManagementApi();
$body = ; // EventsSubscription | The request body containing the details of the destination AWS EventBridge event bus and the events to subscribe to.
$xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
try {
$api_instance->createEventsSubscription($body, $xAmzAccessToken);
} catch (Exception $e) {
echo 'Exception when calling EventSubscriptionManagementApi->createEventsSubscription: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EventSubscriptionManagementApi;
my $api_instance = WWW::SwaggerClient::EventSubscriptionManagementApi->new();
my $body = WWW::SwaggerClient::Object::EventsSubscription->new(); # EventsSubscription | The request body containing the details of the destination AWS EventBridge event bus and the events to subscribe to.
my $xAmzAccessToken = xAmzAccessToken_example; # String | The LWA access token for authorizing the request
eval {
$api_instance->createEventsSubscription(body => $body, xAmzAccessToken => $xAmzAccessToken);
};
if ($@) {
warn "Exception when calling EventSubscriptionManagementApi->createEventsSubscription: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.EventSubscriptionManagementApi()
body = # EventsSubscription | The request body containing the details of the destination AWS EventBridge event bus and the events to subscribe to.
xAmzAccessToken = xAmzAccessToken_example # String | The LWA access token for authorizing the request
try:
# Create events subscription
api_instance.create_events_subscription(body, xAmzAccessToken)
except ApiException as e:
print("Exception when calling EventSubscriptionManagementApi->createEventsSubscription: %s\n" % e)
Parameters
Name | Description |
---|---|
X-Amz-Access-Token* |
String
The LWA access token for authorizing the request
Required
|
Name | Description |
---|---|
body * |