Amazon Yojaka API Event Notifications Model

EventSubscriptionManagement

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

Header parameters
Name Description
X-Amz-Access-Token*
String
The LWA access token for authorizing the request
Required
Body parameters
Name Description
body *

Responses

Status: 204 - Success. The events subscription has been created.

Status: 400 - Bad request. One or more of the input parameters you have provided is invalid.

Status: 401 - Unauthorized. You are not authorized to invoke this API for the given parameters.

Status: 409 - Conflict. An event subscription already exists for the seller.

Status: 500 - Internal server error. Contact Amazon support for assistance.

Status: 503 - Service unavailable. Retry the request after some time.


deleteEventsSubscription

Delete events subscription

Delete the events subscription for the seller. No Amazon Yojaka events will be delivered to the destination for the seller after this API call is invoked.


/events/subscriptions

Usage and SDK Samples

curl -X DELETE "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();
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        try {
            apiInstance.deleteEventsSubscription(xAmzAccessToken);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventSubscriptionManagementApi#deleteEventsSubscription");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.EventSubscriptionManagementApi;

public class EventSubscriptionManagementApiExample {

    public static void main(String[] args) {
        EventSubscriptionManagementApi apiInstance = new EventSubscriptionManagementApi();
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        try {
            apiInstance.deleteEventsSubscription(xAmzAccessToken);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventSubscriptionManagementApi#deleteEventsSubscription");
            e.printStackTrace();
        }
    }
}
String *xAmzAccessToken = xAmzAccessToken_example; // The LWA access token for authorizing the request

EventSubscriptionManagementApi *apiInstance = [[EventSubscriptionManagementApi alloc] init];

// Delete events subscription
[apiInstance deleteEventsSubscriptionWith:xAmzAccessToken
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AmazonYojakaApiEventNotificationsModel = require('amazon_yojaka_api_event_notifications_model');

var api = new AmazonYojakaApiEventNotificationsModel.EventSubscriptionManagementApi()
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.deleteEventsSubscription(xAmzAccessToken, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteEventsSubscriptionExample
    {
        public void main()
        {

            var apiInstance = new EventSubscriptionManagementApi();
            var xAmzAccessToken = xAmzAccessToken_example;  // String | The LWA access token for authorizing the request

            try
            {
                // Delete events subscription
                apiInstance.deleteEventsSubscription(xAmzAccessToken);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EventSubscriptionManagementApi.deleteEventsSubscription: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiEventSubscriptionManagementApi();
$xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request

try {
    $api_instance->deleteEventsSubscription($xAmzAccessToken);
} catch (Exception $e) {
    echo 'Exception when calling EventSubscriptionManagementApi->deleteEventsSubscription: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EventSubscriptionManagementApi;

my $api_instance = WWW::SwaggerClient::EventSubscriptionManagementApi->new();
my $xAmzAccessToken = xAmzAccessToken_example; # String | The LWA access token for authorizing the request

eval { 
    $api_instance->deleteEventsSubscription(xAmzAccessToken => $xAmzAccessToken);
};
if ($@) {
    warn "Exception when calling EventSubscriptionManagementApi->deleteEventsSubscription: $@\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()
xAmzAccessToken = xAmzAccessToken_example # String | The LWA access token for authorizing the request

try: 
    # Delete events subscription
    api_instance.delete_events_subscription(xAmzAccessToken)
except ApiException as e:
    print("Exception when calling EventSubscriptionManagementApi->deleteEventsSubscription: %s\n" % e)

Parameters

Header parameters
Name Description
X-Amz-Access-Token*
String
The LWA access token for authorizing the request
Required

Responses

Status: 204 - Success. The events subscription has been deleted.

Status: 400 - Bad request. One or more of the input parameters you have provided is invalid.

Status: 401 - Unauthorized. You are not authorized to invoke this API for the given parameters.

Status: 404 - Not found. No event subscription found for the seller

Status: 500 - Internal server error. Contact Amazon support for assistance.

Status: 503 - Service unavailable. Retry the request after some time.


getEventsSubscription

Get events subscription

Get the events subscribed and the destination for the events for a seller


/events/subscriptions

Usage and SDK Samples

curl -X GET "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();
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        try {
            EventsSubscription result = apiInstance.getEventsSubscription(xAmzAccessToken);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventSubscriptionManagementApi#getEventsSubscription");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.EventSubscriptionManagementApi;

public class EventSubscriptionManagementApiExample {

    public static void main(String[] args) {
        EventSubscriptionManagementApi apiInstance = new EventSubscriptionManagementApi();
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        try {
            EventsSubscription result = apiInstance.getEventsSubscription(xAmzAccessToken);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventSubscriptionManagementApi#getEventsSubscription");
            e.printStackTrace();
        }
    }
}
String *xAmzAccessToken = xAmzAccessToken_example; // The LWA access token for authorizing the request

EventSubscriptionManagementApi *apiInstance = [[EventSubscriptionManagementApi alloc] init];

// Get events subscription
[apiInstance getEventsSubscriptionWith:xAmzAccessToken
              completionHandler: ^(EventsSubscription output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AmazonYojakaApiEventNotificationsModel = require('amazon_yojaka_api_event_notifications_model');

var api = new AmazonYojakaApiEventNotificationsModel.EventSubscriptionManagementApi()
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. Returned data: ' + data);
  }
};
api.getEventsSubscription(xAmzAccessToken, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getEventsSubscriptionExample
    {
        public void main()
        {

            var apiInstance = new EventSubscriptionManagementApi();
            var xAmzAccessToken = xAmzAccessToken_example;  // String | The LWA access token for authorizing the request

            try
            {
                // Get events subscription
                EventsSubscription result = apiInstance.getEventsSubscription(xAmzAccessToken);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EventSubscriptionManagementApi.getEventsSubscription: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiEventSubscriptionManagementApi();
$xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request

try {
    $result = $api_instance->getEventsSubscription($xAmzAccessToken);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EventSubscriptionManagementApi->getEventsSubscription: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EventSubscriptionManagementApi;

my $api_instance = WWW::SwaggerClient::EventSubscriptionManagementApi->new();
my $xAmzAccessToken = xAmzAccessToken_example; # String | The LWA access token for authorizing the request

eval { 
    my $result = $api_instance->getEventsSubscription(xAmzAccessToken => $xAmzAccessToken);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling EventSubscriptionManagementApi->getEventsSubscription: $@\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()
xAmzAccessToken = xAmzAccessToken_example # String | The LWA access token for authorizing the request

try: 
    # Get events subscription
    api_response = api_instance.get_events_subscription(xAmzAccessToken)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EventSubscriptionManagementApi->getEventsSubscription: %s\n" % e)

Parameters

Header parameters
Name Description
X-Amz-Access-Token*
String
The LWA access token for authorizing the request
Required

Responses

Status: 200 - Success. The events subscription information is in the response payload.

Status: 400 - Bad request. One or more of the input parameters you have provided is invalid.

Status: 401 - Unauthorized. You are not authorized to invoke this API for the given parameters.

Status: 404 - Not found. No event subscription found for the seller

Status: 500 - Internal server error. Contact Amazon support for assistance.

Status: 503 - Service unavailable. Retry the request after some time.


updateEventsSubscription

Update events subscription

Update a subscription for one or more Amazon Yojaka events for a seller. Either the destination AWS EventBridge event bus or the set of events or both can be updated in a single API call.


/events/subscriptions

Usage and SDK Samples

curl -X PUT "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 indicting details of the packages, including their dimensions and weight
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        try {
            apiInstance.updateEventsSubscription(body, xAmzAccessToken);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventSubscriptionManagementApi#updateEventsSubscription");
            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 indicting details of the packages, including their dimensions and weight
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        try {
            apiInstance.updateEventsSubscription(body, xAmzAccessToken);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventSubscriptionManagementApi#updateEventsSubscription");
            e.printStackTrace();
        }
    }
}
EventsSubscription *body = ; // The request body indicting details of the packages, including their dimensions and weight
String *xAmzAccessToken = xAmzAccessToken_example; // The LWA access token for authorizing the request

EventSubscriptionManagementApi *apiInstance = [[EventSubscriptionManagementApi alloc] init];

// Update events subscription
[apiInstance updateEventsSubscriptionWith: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 indicting details of the packages, including their dimensions and weight
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.updateEventsSubscription(bodyxAmzAccessToken, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateEventsSubscriptionExample
    {
        public void main()
        {

            var apiInstance = new EventSubscriptionManagementApi();
            var body = new EventsSubscription(); // EventsSubscription | The request body indicting details of the packages, including their dimensions and weight
            var xAmzAccessToken = xAmzAccessToken_example;  // String | The LWA access token for authorizing the request

            try
            {
                // Update events subscription
                apiInstance.updateEventsSubscription(body, xAmzAccessToken);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EventSubscriptionManagementApi.updateEventsSubscription: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiEventSubscriptionManagementApi();
$body = ; // EventsSubscription | The request body indicting details of the packages, including their dimensions and weight
$xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request

try {
    $api_instance->updateEventsSubscription($body, $xAmzAccessToken);
} catch (Exception $e) {
    echo 'Exception when calling EventSubscriptionManagementApi->updateEventsSubscription: ', $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 indicting details of the packages, including their dimensions and weight
my $xAmzAccessToken = xAmzAccessToken_example; # String | The LWA access token for authorizing the request

eval { 
    $api_instance->updateEventsSubscription(body => $body, xAmzAccessToken => $xAmzAccessToken);
};
if ($@) {
    warn "Exception when calling EventSubscriptionManagementApi->updateEventsSubscription: $@\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 indicting details of the packages, including their dimensions and weight
xAmzAccessToken = xAmzAccessToken_example # String | The LWA access token for authorizing the request

try: 
    # Update events subscription
    api_instance.update_events_subscription(body, xAmzAccessToken)
except ApiException as e:
    print("Exception when calling EventSubscriptionManagementApi->updateEventsSubscription: %s\n" % e)

Parameters

Header parameters
Name Description
X-Amz-Access-Token*
String
The LWA access token for authorizing the request
Required
Body parameters
Name Description
body *

Responses

Status: 204 - Success. The events subscription has been updated.

Status: 400 - Bad request. One or more of the input parameters you have provided is invalid.

Status: 401 - Unauthorized. You are not authorized to invoke this API for the given parameters.

Status: 404 - Not found. No event subscription found for the seller

Status: 500 - Internal server error. Contact Amazon support for assistance.

Status: 503 - Service unavailable. Retry the request after some time.