POST v1/accounts/{foreignaccountkey}/subscriptions

Create a new Api Subscription.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
foreignaccountkey

string

Required

Body Parameters

EventSubscription
NameDescriptionTypeAdditional information
Id

string

None.

Hook

Hook

None.

IntegrationName

string

None.

ForeignAccountKey

string

None.

Events

Collection of string

None.

ExpiryDate

date

None.

Credentials

string

None.

Auth

Auth

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": "sample string 1",
  "Hook": {
    "HookType": "Endpoint",
    "Endpoint": "sample string 1",
    "Provider": "Azure"
  },
  "IntegrationName": "sample string 2",
  "ForeignAccountKey": "sample string 3",
  "Events": [
    "sample string 1",
    "sample string 2"
  ],
  "ExpiryDate": "2018-12-14T12:06:01.9757675+00:00",
  "Credentials": "sample string 5",
  "Auth": {
    "AuthType": "None",
    "Name": "sample string 1",
    "Secret": "sample string 2"
  }
}

application/xml, text/xml

Sample:
<EventSubscription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AS.Models.API">
  <Auth xmlns:d2p1="http://schemas.datacontract.org/2004/07/AS.Interfaces.Models">
    <d2p1:AuthType>None</d2p1:AuthType>
    <d2p1:Name>sample string 1</d2p1:Name>
    <d2p1:Secret>sample string 2</d2p1:Secret>
  </Auth>
  <Credentials>sample string 5</Credentials>
  <Events xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Events>
  <ExpiryDate>2018-12-14T12:06:01.9757675+00:00</ExpiryDate>
  <ForeignAccountKey>sample string 3</ForeignAccountKey>
  <Hook xmlns:d2p1="http://schemas.datacontract.org/2004/07/AS.Interfaces.Models">
    <d2p1:Endpoint>sample string 1</d2p1:Endpoint>
    <d2p1:HookType>Endpoint</d2p1:HookType>
    <d2p1:Provider>Azure</d2p1:Provider>
  </Hook>
  <Id>sample string 1</Id>
  <IntegrationName>sample string 2</IntegrationName>
</EventSubscription>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'EventSubscription'.

Response Information

Resource Description

PBPRReturnOfISubscriptionResponse
NameDescriptionTypeAdditional information
Data

ISubscriptionResponse

None.

Success

Gets the success status of the API call

boolean

None.

Meta

Gets the optional meta-data

Dictionary of string [key] and string [value]

None.

Code

Get the http code of the API call e.g. 200, 202, 409

integer

None.

ErrorCode

Get the failure error code of the API call. This is available if Success is false

integer

None.

ErrorSubCode

Gets the error sub code if available

integer

None.

ErrorDescription

Gets a textual description of the error

string

None.

StatusUrl

Gets the status url for any ACCEPTed API commands. Any command (POST,DELETE,PATCh,PUT) to the API usually returns a 202 response code. The status of the command can be queried using the URL provided

string

None.

ContinuationToken

Gets the token to be used for paged queries

string

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "Meta": {
    "sample string 1": "sample string 2",
    "sample string 3": "sample string 4"
  },
  "Code": 2,
  "ErrorCode": 3,
  "Data": null,
  "ErrorSubCode": 4,
  "ErrorDescription": "sample string 5",
  "StatusUrl": "sample string 6",
  "ContinuationToken": "9%2BGwreX02aWOvePr6qC2hA%3D%3D"
}

application/xml, text/xml

Sample:
<PBPRReturnOfanyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AS.Models.API">
  <Code>2</Code>
  <ContinuationToken>9%2BGwreX02aWOvePr6qC2hA%3D%3D</ContinuationToken>
  <ErrorCode>3</ErrorCode>
  <ErrorDescription>sample string 5</ErrorDescription>
  <ErrorSubCode>4</ErrorSubCode>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 1</d2p1:Key>
      <d2p1:Value>sample string 2</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 3</d2p1:Key>
      <d2p1:Value>sample string 4</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <StatusUrl>sample string 6</StatusUrl>
  <Success>true</Success>
  <Data i:nil="true" />
</PBPRReturnOfanyType>