API Configuration Services

From ePrize Developers Wiki

Revision as of 16:33, 28 January 2013 by Steve-carter (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

API Home Page

Summary

Configuration Services allows promotion builders the ability to configure certain types of ePrize promotions to alter their behavior even while the promotion is live. Authorization is handled via API keys passed in the headers of requests that require auth.

NOTE: THIS IS NOT LIVE YET. We will update this page once the service goes into production.

Resource

/v2/{appkey}/configuration

Valid Methods

GET

Resource Arguments

Note: resource arguments are always required.

appkey: Your APP key.

Parameters Required

None.



Example: Retrieve a configuration

Summary

This demonstrates successfully retrieving a configuration for an APP key

Request

GET https://eprize.api.promo.eprize.com/v2/{appkey}/configuration

Response

HTTP Status Code: 200 OK


{"configType": "base","name": "somepromo","configDate": "2013-01-28T11:10:55.147-05:00"}


Example: Creating a new configuration

Summary

This demonstrates creating a new configuration utilizing your public and private API keys.

Request

POST https://eprize.api.promo.eprize.com/v2/{appkey}/configuration

Response

HTTP Status Code: 201 CREATED


The Location header will contain a URL to the newly created resource

Notes

You must also add two authorization headers to the request. X-Public-Key and X-Private-Key must be set to your public/private keypair. The "appkey" set in the URL is the name of the app to be created. If it already exists it WILL BE OVERWRITTEN. This is in place to allow changing the configuration type for a promotion.

Example: Updating a configuration

Summary

This demonstrates updating a configuration value using the API.

Request

PUT https://eprize.api.promo.eprize.com/v2/{appkey}/configurtion

Response

HTTP Status Code: 200 OK


The new configuration, same as a GET request for the same URL

Notes

An If-Match header must be set to the same value as the ETag header passed back in a GET request for the same URL. This helps prevent conflicts from being overwritten. This also requires the X-Public-Key and X-Private-Key headers to be set appropriately, same as a POST request.

Personal tools