alayamarket-external-docs

User Guide

Become a participant

To join the AlayaCare Marketplace as a demand or supply participant, contact your AlayaCare Customer Success Manager or contact us on team-alayamarket@alayacare.com.

Getting started

Once you’re signed up as a participant, you’ll be able to use your account credentials to access our APIs.

Server

The Marketplace server domain name will depend on your environment and region:

The examples below will refer to the server for your environment and region as $SERVER.

Tools

Below you’ll find some examples of how to use our APIs. These examples use a tool called httpie to perform http requests.

brew install httpie

Login

To login you will need the username and password account credentials provided during sign up.

http POST $SERVER/auth/v1/login username=<username> password=<password>

The response will contain an IdToken that will be used for subsequent requests.

Authentication Headers

HTTP requests are authenticated using token authentication. To authenticate a http request, include an Authorization header referencing the IdToken returned during login:

Authorization:<IdToken>

Get your Offers

Demand

As a demand participant, you will use the Outbox APIs to create and manage your offers. You can see the offers that you have created from the Offers Outbox:

http GET $SERVER/offers/v1/outbox/offers Authorization:<IdToken>

Supply

As a supply participant, you will use the Inbox APIs to receive and respond to your offers. You can see the offers that you have been matched with from the Offers Inbox:

http GET $SERVER/offers/v1/inbox/offers Authorization:<IdToken>

For the complete HTTP API specifications, see Documentation.

Get your Events

Rather than polling our APIs, you can subscribe to our events to be alerted when something changes. For more details, see Documentation.

Demand

As a demand participant, you will use the Outbox topics to receive events like an offer was accepted or declined, see e.g here.

Supply

As a supply participant, you will use the Inbox topics to receive events like an offer was matched or closed, see e.g here.

Terminology

Documentation

HTTP APIs

The Marketplace exposes HTTP APIs to manage authentication, organization settings, and offers and referrals:

Async APIs

The Marketplace supports event driven communication using Async APIs to notify you of relevant changes, such as when an offer is matched or accepted.

Subscribing to Async APIs

We do not support self-serve subscribing. Please reach out to us on team-alayamarket@alayacare.com with the endpoints or email addresses you would like to subscribe.

Confirming your subscriptions

Notifications are delivered using AWS SNS. You will need to confirm your subscriptions before they become active.

For email subscriptions, you will receive an email containing a link that must be clicked to confirm your subscription.

For http subscriptions, you will receive a confirmation event containing a SubscribeURL that you will need to perform a GET request on. Subscription events have a payload containing "Type" : "SubscriptionConfirmation". For more information, see here.

Consuming your events

Once your endpoints are confirmed, you can start to receive notification events. These events have a payload containing "Type" : "Notification" and a "Message" containing the data described in the Async API specs. For more information, see here.