REST API
Should you read this? You probably will need to at some point. This is all about server-side API integration. This is useful if you want to create or manage resources on the back-end, or if you want to do server-side access control.
What APIs Are Available?
If you haven’t had a chance to check out the REST API Interface Overview you probably should do that right now. We’ll wait.
Ok - now that that’s all sorted, let’s talk about the APIs or endpoints. The Wallit REST API is really split into two main APIs with multiple endpoints on each. Both Access API and Manage API communicate with the same protocols and message formats. The only thing different is the type of API key you use for each. Remember, use the proper API Key from the Manage UI for each of the APIs.
API Request Format
There are three headers that are required with each request: Accept
, Timestamp
and Authentication
. If your request
contains a payload, an additional Content-Type
header is needed.
Message Data Format
The APIs support JSON data. When making an HTTP request to the API, use the following two headers to indicate JSON:
Header Name | Value |
---|---|
Content-Type |
application/json |
Accept |
application/json |
If your system does not currently support JSON, please contact us for personal assistance and support.
Timestamp
Each request requires a Timestamp
header in UTC RFC1123 format. Please make sure that your
server time is correct. We accept requests that are dated within 5 minutes before or after the current time maximum. Otherwise,
your request will be rejected with a HTTP 401 or HTTP 403 error.
Authentication
The Authentication
header is required on each request. The format is the current API key, a colon, and then the authentication token.
Requests without an Authentication header, without a token, or with an invalid token, will result in an HTTP 401 error.
Each token is created by a hash calculated for each request.
To create the token, follow the following steps:
1) Join the four strings described below and join them with a new line character
2) Hash the string using Binary SHA-256 HMAC using the secret key associated with the API key you’re using
3) Base64 encode the output
For example, you might see something like this:
Authentication: BB772A5B-1E7B-461C-8AC6-CA9E6E2FD2B9:y8s48zxCy62NXUFe5699i7vktOpLvDnt2TCifpZDzJw=
Token Values
The following table describes the four pieces of content that are required to create the hash.
Item | Description | Example |
---|---|---|
HTTP Method | The method used for this request in all caps. | POST |
Timestamp | The timestamp described above. | Wed, 05 Oct 2016 15:08:05 GMT |
URI of Request | Convert this value to all lower case. Do not include any query strings. | /api/property/bb772a5b-1e7b-461c-8ac6-ca9e6e2fd2b9 |
Query Parameters | Ampersand-joined alphabetically ordered list of parameters used for this request. Both names and values should be lowercase and not url-encoded. | byline=guy smiley&externalkey=1234&name=my article |
Looking to validate your token? Good news - we’ve built a tool that can help you.
Go to the Token Validation Tool.
API Endpoint Documentation
This section describes the API URL’s and endpoints for Wallit.
Resource Access API
The Resource Access API is used for access control, validating a user’s access to content.
https://accessapi.wallit.io
Returns access data about a resource based on its resource key
Parameters
Name | Where | Description | Type |
---|---|---|---|
accessKey
|
path | Your Resource Access API access key. |
String |
resourceKey
|
path | The external key for the resource being accessed. |
String |
ResourceURL
|
query | A URL for the resource. If dynamic resource creation needs to occur, this URL will be spidered by iMoneza to gather resource data. |
String |
UserToken
|
query | An existing user token that was stored as a cookie. This value can be empty if the user doesn’t have an existing user token cookie, but the parameter is required. |
String |
IP
|
query | The IP address of the user requesting a resource. This parameter is optional. The IP address can be IPv4 or IPv6. |
String |
AdBlockerStatus
|
query | The result of any ad blocker detection performed by the API consumer. |
String
|
UseLegacyPaywall
|
query | Whether or not to use the legacy paywall. |
Boolean |
Responses
200 |
A resource access object |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Returns resource access data based on a temporary user token.
Parameters
Name | Where | Description | Type |
---|---|---|---|
accessKey
|
path | Your Resource Access API access key. |
String |
temporaryUserToken
|
path | A temporary user token that was passed to the page in the iMonezaTUT URL parameter. |
String |
ResourceKey
|
query | The external key for the resource being accessed. |
String |
ResourceURL
|
query | A URL for the resource. If dynamic resource creation needs to occur, this URL will be spidered by iMoneza to gather resource data. |
String |
IP
|
query | The IP address of the user requesting a resource. This parameter is optional. The IP address can be IPv4 or IPv6. |
String |
AdBlockerStatus
|
query | The result of any ad blocker detection performed by the API consumer. |
String
|
UseLegacyPaywall
|
query | Whether or not to use the legacy paywall. |
Boolean |
Responses
200 |
A resource access object |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Resource Management API
This API is used for managing resource data, providing merchants access to certain resource-level configuration without needing to use the Management UI.
https://manageapi.wallit.io
Returns property information including access information and subscription & pricing groups.
Parameters
Name | Where | Description | Type |
---|---|---|---|
propertyID
|
path | The Property ID for this request. |
String |
Responses
200 |
A property object |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Returns all the resources belonging to a property.
Parameters
Name | Where | Description | Type |
---|---|---|---|
propertyID
|
path | The Property ID for this request. |
String |
Responses
200 |
An array of resource objects |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Creates/Updates a resource, identified by an external key.
Parameters
Name | Where | Description | Type |
---|---|---|---|
propertyID
|
path | The Property ID for this request. |
String |
externalKey
|
path | The external key or public identifier of a resource. |
String |
ExternalKey
|
formData | The external key or public identifier of a resource. |
String |
Name
|
formData | The internal name of the resource (required only on creation) |
String |
Active
|
formData | Boolean of whether this item is active |
Boolean |
URL
|
formData | The URL of the resource |
String |
Title
|
formData | The title of the resource |
String |
Byline
|
formData | Who authored the resource |
String |
Description
|
formData | Description of the resource that appears if the paywall type is set to “Modal” |
String |
PublicationDate
|
formData | The publication date of the resource |
String |
PricingGroup
|
formData | Update or set the pricing group for the resource (required only on creation) (see special formatting notes below) |
String |
PricingModel
|
formData | The resource pricing model |
String
|
Price
|
formData | The price of the resource |
Number |
ExpirationPeriodUnit
|
formData | Expiration Period Unit |
String
|
ExpirationPeriodValue
|
formData | Expiration Period Value |
String |
TargetConversionRate
|
formData | Target Conversion Rate |
String |
TargetConversionPriceFloor
|
formData | Target Conversion Price Floor |
String |
TargetConversionHitsPerRecalculationPeriod
|
formData | Target Conversion Hits Per Recalculation Period |
String |
PaywallDescription
|
formData | The description of the resource that will appear on the Purchase Options step on the paywall |
String |
PaywallShortDescription
|
formData | The short description of the resource that will appear at the top of paywall after the Purchase Options step |
String |
Responses
200 |
Successful creation or updating of the item. |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Adds or updates a single external subscriber.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The api key for this request. |
String |
subscriberKey
|
path | The subscriber key |
String |
SubscriberKey
|
formData | The subscriber key |
String |
MaximumLinkedUsers
|
formData | Maximum Linked Users |
String |
ValidationFields
|
formData | Array of objects with two properties - |
String |
EligibleSubscriptions
|
formData | An array of objects with two properties - |
String |
AutomaticSubscriptions
|
formData | An array of objects with two properties - |
String |
Responses
200 |
A subscriber element containing only the demographic fields |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Retrieves a single external subscriber and linked iMoneza users.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
subscriberKey
|
path | The subscriber key |
String |
Responses
200 |
A subscriber element |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Add or update multiple external subscribers.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
data
|
formData | Contains a property called |
String |
Responses
200 |
A queue element |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Begins an external subscriber export.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
StartDate
|
formData | The timestamp of the beginning of the list |
String |
EndDate
|
formData | The timestamp of the end of the list |
String |
Responses
200 |
A queue element |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Begins an external fulfillment export of subscribers eligible at the date given.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
SubscriptionGroupID
|
formData | The subscription group ID that needs to be fulfilled |
String |
AsOfDate
|
formData | The timestamp indicating the point in time to retrieve active subscriptions from. |
String |
NotificationEmailAddress
|
formData | An optional email address that will be notified when this finishes. |
String |
Responses
200 |
A queue element |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Retrieve data about an iMoneza user after an external subscriber is linked
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
ExternalSubscriberLinkedCallbackToken
|
path | This is the token retrieved from the callback of type |
String |
Responses
200 |
A data element with a subscriber element child (the |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Retrieve data about a subscription purchase
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
EligibleSubscriptionPurchasedCallbackToken
|
path | This is the token retrieved from the callback of type |
String |
Responses
200 |
A data element with a subscriber element child |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Retrieve information about the external subscriber import including any errors that occurred.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
ExternalSubscriberImportCompletedCallbackToken
|
path | This is the token retrieved from the callback of type |
String |
Responses
200 |
A status object |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Retrieve the external subscriber export.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
ExternalSubscriberExportCompletedCallbackToken
|
path | This is the token retrieved from the callback of type |
String |
Responses
200 |
An array of external subscribers |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Retrieve the external fulfillment subscription export.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
ExternalFulfillmentSubscriptionExportCallbackToken
|
path | This is the token retrieved from the callback of type |
String |
Responses
200 |
An array of external fulfillment subscriptions |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
Retrieve the external fulfillment information after a user has purchased one.
Parameters
Name | Where | Description | Type |
---|---|---|---|
apiKey
|
path | The Property ID for this request. |
String |
ExternalFulfillmentSubscriptionPurchasedCallbackToken
|
path | This is the token retrieved from the callback of type |
String |
Responses
200 |
An object indicating the subscription data and demographic fields that the merchant has defined. |
401 |
Authentication Failure |
403 |
Not Authorized |
404 |
Item Not found |
API Special Notes
When executing a PUT request on a resource, it will either create or update the item. Any subsequent calls with that external ID will update only the parameters sent. For example, if the next request contains only the Title property, all other properties will remain the same, only the Title will be changed. The ExternalKey cannot be changed with this request.
To change the pricing group that a resource belongs to, the pricing group ID should be sent. All other data sent in a PricingGroup object will be ignored. For instance, the following would change the pricing group:
{
"PricingGroup": {
"PricingGroupID": "15bf02c5-d106-e411-acf1-bc305bd0d54e"
}
}
Pricing tiers are stored as an array called ResourcePricingTiers. If that object is null or not-defined, pricing tiers are not updated; if that array is present, then all existing pricing tiers are replaced by the array. So if any pricing tiers are set, then all pricing tiers must be set. For example:
{
"ExternalKey": "Article1",
"ResourcePricingTiers": [
{
"Tier": 0,
"Price": 0.00
},
{
"Tier": 2,
"Price": 0.18
},
{
"Tier": 5,
"Price": 0.50
},
{
"Tier": 10,
"Price": 0.72
}
]
}
What’s Next?
Now that you know how to send and receive information on your own time, what about when we do things?