NAV Navbar
shell

Program API

Welcome to Program API for Cheetah Digital EDP/Loyalty.

The Program API is be used by brands and partners to directly integrate their existing systems with the Cheetah Digital EDP and Loyalty servers.

This documentation assumes that you have a Cheetah Digital EDP or Loyalty environment up and running. If not, contact Cheetah Digital for a demo.

Getting Started

Before you create your own connectors or apps running on top of the Program API, make sure you have a valid login to your Cheetah Digital EDP or Loyalty.

Then, navigate to the Applications screen in the Cheetah Digital EDP / Loyalty to get your Program API OAuth Client ID and Client Secret.

Some Program APIs allow operation without an access_token but requires a valid pair of client_id and client_secret with proper scope. Example of this is the SSO APIs.

If you're using Postman, you can start by importing this JSON file as your collection.

File and Message Transports

While Cheetah Digital APIs are documented as REST APIs, they can also be accessed via message queue or file transports.

To invoke a Cheetah Digital API via queue, publish a message to the inbound queue of a Cheetah Digital deployment environment with the following structure:

JSON Element Value
url API URl, such as /program/api/members
method REST method, such as GET or PUT
parameters the parameters expected by the API, as documented here

For example, if the API documentation is:

curl -X PUT
     -H "Accept: application/vnd.stellar-v1+json"
     -F "access_token=<access_token>"
     -F "first_name=Myrtice"
     -F "last_name=Ortiz"
     -F "email=alford7@medhurst.org"
     <base_url>/program/api/members/<id>

Then the message on the queue or the content of the inbound file should be:

{
  "url": "/program/api/members/<id>",
  "method": "PUT",
    "parameters": {
          "first_name": "Myrtice",
          "last_name": "Ortiz",
          "email": "alford7@medhurst.org"
    }
}

Similarly, the response file or message is as per the JSON response documented here.

Terminologies

This section describes most of the terms you will encounter when working with the Cheetah Digital Program APIs.

Term Description
base_url Domain name of Cheetah Digital EDP including http(s) protocol. Example is https://mycompany.cheetahedp.com.
access_token Required URL parameter or form parameter for all endpoint operations.
code Error response code as part of response. This will always be part of response JSON whenever an error is encountered. Refer to Errors.
Header Parameters Required http headers to ensure that client is properly configured and integration developers have done their homework right.
Form Parameters HTTP form parameters. Used mostly when submitting changes on existing resource or creating new resource.
URL Parameters HTTP URL parameters or query string. Commonly seen when accessing an existing resource from the server.

Authentication

In the Cheetah Digital Marketing Console, navigate to the Admin tab, then to the OAuth Applications screen (<base_url>/console/apps). Search for an OAuth Application that has a scope of 'big_data and producer'.

The OAuth client_id is readily visible on the screen. To retrieve the OAuth client_secret, drill down to the OAuth Applications detail page (e.g. <base_url>/console/apps/1) and click on 'Show Secret' button to reveal the client secret.

Use the returned access token in subsequent API calls.

To authorize, use this code:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "grant_type=client_credentials"
     -F "client_id=<client_id>"
     -F "client_secret=<client_secret>"
     <base_url>/oauth/token

Returns JSON with access_token. Store this access_token value later use in all operations.

{
  "access_token": "9f3bb60acf8bf0297c965c432s650c27254da7e66ffe8db32eadc2a0667046a0",
  "token_type": "bearer",
  "expires_in": 7200,
  "created_at": 1508806463
}

HTTP Request

POST <base_url>/oauth/token

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

Form Parameters

Parameter Type Description
grant_type string (required) required value is client_credentials
client_id string (required) oauth app client_id value
client_secret string (required) oauth app client_secret value

Members

All member related operations is done under this path

<base_url>/program/api/members

Some endpoints, such as Delete and Update, require an id parameter to identify the member. The id parameter can be the member_id, the member's database id, the member's integration id, or the member's card id.

List All Members

Return a paginated list of members.

Use the optional page parameter to specify the page offset to start with.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members

Returns paginated list of members:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "members": [
      {
        "id": 10,
        "email": "nash.grant4@collier.org",
        "member_id": "C-000000001",
        "first_name": "Nelson",
        "last_name": "Klein",
        "integration_id": null,
        "card_id": "9999999",
        "created_at": "2016-07-04T02:33:52.000Z",
        "updated_at": "2016-07-04T04:20:45.000Z"
      },
      {
        "id": 11,
        "email": "trisha.kuphal5@reichel.name",
        "member_id": "C-000000002",
        "first_name": "Nelson",
        "last_name": "Klein",
        "integration_id": null,
        "card_id": "8888888",
        "created_at": "2016-07-04T02:33:52.000Z",
        "updated_at": "2016-07-04T04:20:45.000Z"
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/members

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50

Search members

Search for a member that matches the provided term parameter. This API searches against Member Id, First Name, Last Name, Full Name, Email, Email Alias, Card ID, Mobile Phone, Device Token, User Token, Integration ID, Integration ID 2, Integration ID 3, Integration ID 4, Integration ID 5 or Integration ID 6 using OR, similar to search in the Cheetah Digital Marketing Console's Member screens (/console/members).

Note: If URL query param includes lookup attribute from Get Member, i.e. integration_id and matches as single record, Get Member JSON resonse is returned.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members?term=nash

Returns paginated list of members:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "members": [
      {
        "id": 11,
        "email": "nash.grant4@collier.org",
        "member_id": "C-000000001",
        "first_name": "Nash",
        "last_name": "Grant",
        "integration_id": null,
        "card_id": "8888888",
        "created_at": "2016-07-04T02:33:52.000Z",
        "updated_at": "2016-07-04T04:20:45.000Z"
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/members

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
term string (required) Search term
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50

Get Member

Get details about an existing member.

This API returns the member information as a hash of member attributes.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "integration_id=<external id>"
     <base_url>/program/api/members

Returned JSON

{
  "success": true,
  "data": {
    "email": "leland1@daniel.net",
    "email_alias": "",
    "username": "",
    "first_name": "Furman",
    "last_name": "Wolf",
    "mailing_street": "",
    "mailing_street2": "",
    "mailing_city": "",
    "mailing_state": "",
    "mailing_postal_code": "",
    "mailing_country": "",
    "birthdate": "",
    "mobile_phone": "",
    "member_since": "2016-04-22",
    "member_id": "M-000000001",
    "receive_sms_offers": true,
    "receive_mobile_app_offers": true,
    "receive_mail_offers": true,
    "receive_e_statements": true,
    "current_tier": "",
    "expiration_date": "",
    "tier_in_progression": "",
    "suspend_email": false,
    "suspend_email_date": "",
    "suspend_email_cause": "",
    "referrer_id": "",
    "referral_code": [
        "8V9UHKTXN2"
    ],
    "last_active_at": "",
    "deactivated": false,
    "integration_id": "",
    "integration2_id": "",
    "integration3_id": "",
    "integration4_id": "",
    "integration5_id": "",
    "integration6_id": "",
    "gender": "",
    "marital_status": "",
    "education": "",
    "income": "",
    "has_children": "",
    "employment": "",
    "employee": false,
    "ethnicity": "",
    "housing": "",
    "test_member": false,
    "visitor": false,
    "suspend_redemption": false,
    "card_id": "",
    "receive_newsfeed_like_notification": true,
    "receive_newsfeed_comment_notification": true,
    "company": "",
    "receive_personalized_offers": true,
    "receive_statements": "Monthly",
    "confirmed_at": "",
    "created_at": "2019-12-05T06:05:22.000Z",
    "has_device": false,
    "parent_member_id": "",
    "child_member_ids": [],
    "place_integration_id": "",
    "region_integration_id": "",
    "migrated": "",
    "sl_metric_transfer_destination": "",
    "sl_metric_transfer_sources": [],
    "avatar_updated_at": "",
    "suspend_sms": false,
    "suspend_sms_date": "",
    "suspend_sms_cause": "",
    "device_platform_types": [],
    "address_isvalid": false,
    "locale_code": "en-CA",
    "avatar_url": "",
    "place_label": "",
    "id": 14
  }
}

HTTP Request

GET <base_url>/program/api/members

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Note: You can also use it in Form parameters.

Parameter Type Description
member_id string (optional) member_id of member to lookup
integration_id string (optional) integration_id of member to lookup
card_id string (optional) card_id of member to lookup
mobile_phone string (optional) mobile_phone of member to lookup
id integer (optional) id of member to lookup
email string (optional) email of member to lookup
username string (optional) username of member to lookup
integration2_id string (optional) integration2_id of member to lookup
integration3_id string (required) integration3_id from successful login
integration4_id string (optional) integration4_id of member to lookup
integration5_id string (required) integration5_id from successful login
integration6_id string (required) integration6_id from successful login

Create Member

Create a new member and set the member's information to the hash of member attributes.

Notes:

Marketers define member attributes in the Cheetah Digital Marketing Console's Member Attributes screen (/console/member_attributes), and must publish the Cheetah Digital Program Metadata before referencing new member attributes in this API.

In case you want to create a member record but do not have other attribute values ready, just pass parameters with only integration_id and leave other fields blank.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "first_name=Hillard"
     -F "last_name=Paucek"
     -F "email=elyse@barton.org"
     -F "password=12345678"
     -F "integration4_id=4-123404321"
     <base_url>/program/api/members

Returns all the attributes of created member

{
  "success": true,
  "data": {
    "email": "elyse@barton.org",
    "first_name": "Hillard",
    "mobile_phone": "",
    "last_name": "Paucek",
    "last_active_at": null,
    "test_member": false,
    "mailing_street": "",
    "mailing_city": "",
    "mailing_state": "",
    "mailing_postal_code": "",
    "mailing_country": "",
    "birthdate": null,
    "receive_email_offers": true,
    "receive_sms_offers": true,
    "receive_mobile_app_offers": true,
    "receive_mail_offers": true,
    "receive_e_statements": true,
    "current_tier": "",
    "expiration_date": null,
    "tier_in_progression": "",
    "suspend_email": false,
    "suspend_email_date": null,
    "suspend_email_cause": "",
    "referrer_id": "",
    "gender": "",
    "marital_status": "",
    "education": "",
    "income": "",
    "has_children": "",
    "employment": "",
    "ethnicity": "",
    "housing": "",
    "suspend_redemption": false,
    "member_since": "2016-04-22T00:00:00.000Z",
    "integration_id": "",
    "integration2_id": "",
    "integration3_id": "",
    "integration4_id": "4-123404321",
    "integration5_id": "",
    "integration6_id": "",
    "card_id": "8888888",
    "deactivated": false,
    "visitor": false,
    "member_id": "M-1111111111"
  }
}

Failed response will return 406 code and something like:

{
   "code":4400,
   "name":"invalid_record",
   "message":"Email has already been taken."
}

HTTP Request

POST <base_url>/program/api/members

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Update Member

Update an existing member and set the member's information to the hash of member attributes.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "first_name=Myrtice"
     -F "last_name=Ortiz"
     -F "email=alford7@medhurst.org"
     -F "integration_id=1029384756"
     <base_url>/program/api/members/<id>

Returns only changed columns of member

{
  "success": true,
  "data": {
    "first_name": "Myrtice",
    "last_name": "Ortiz"
  }
}

● Deactivate a member's account

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "deactivated=true"
     <base_url>/program/api/members/<id>

● Flag a member as visitor

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "visitor=true"
     <base_url>/program/api/members/<id>

Failed response will return 406 code and something like:

{
  "code": 4400,
  "name": "invalid_record",
  "message": "Email has already been taken."
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/members/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
id string (optional) database id of member to update
member_id string (optional) member_id of member to update submitted as id
integration_id string (optional) integration_id of member to update submitted as id
card_id string (optional) card_id of member to update submitted as id

Delete Member

Delete an existing member.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>

Returns JSON of deleted resource

{
  "success": true,
  "data": {
    "email": "foo@barbar123.com",
    "first_name": "foo",
    "last_name": "bar",
    "mobile_phone": "",
    "member_since": "2016-06-24T05:00:34.000Z",
    "integration_id": "",
    "last_active_at": null,
    "deactivated": false,
    "test_member": false,
    "visitor": false,
    "card_id": "",
    "referrer_id": "",
    "mailing_street": "",
    "mailing_city": "",
    "mailing_state": "",
    "mailing_postal_code": "",
    "mailing_country": "US",
    "birthdate": null,
    "receive_email_offers": true,
    "receive_sms_offers": true,
    "receive_mobile_app_offers": true,
    "receive_mail_offers": true,
    "receive_e_statements": true,
    "current_tier": "",
    "expiration_date": null,
    "tier_in_progression": "",
    "instagram_profile": "",
    "twitter_profile": "",
    "facebook_profile": "",
    "about_me": "",
    "school_name": "",
    "retailer_name": "",
    "retailer": "",
    "suspend_email": false,
    "suspend_email_date": null,
    "suspend_email_cause": "",
    "member_type": "student",
    "member_comments": "",
    "grade": "",
    "high_school": "",
    "high_school_location": "",
    "age": 0,
    "marital_status": "",
    "education": "",
    "income": "",
    "has_children": "",
    "employment": "",
    "ethnicity": "",
    "housing": "",
    "gender": "",
    "suspend_redemption": false,
    "gc_auto_reload": false,
    "gc_reload_threshold": 0,
    "gc_reload_amount": 0,
    "id": 41071,
    "member_id": "IDGAFWOOKIE-000004574"
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/members/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id to delete
access_token string (required) access_token from successful login

URL Parameters

Parameter Type Description
id string (optional) database id of member to delete
member_id string (optional) member_id of member to delete submitted as id
integration_id string (optional) integration_id of member to delete submitted as id
card_id string (optional) card_id of member to delete submitted as id
access_token string (required) access_token from successful login

Update Member Password

Update an existing member's password.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "password=<password>"
     -F "password_confirmation=<password_confirmation>"
     <base_url>/program/api/members/<id>/password?access_token=<access_token>

Returns JSON if operation is successful

{
  "success": true
}

Return JSON if passwords do not match

{
  "code": 4066,
  "name": "invalid_record",
  "message": "Password confirmation doesnt match Password."
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/members/<id>/password

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id to change password

Query Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
password string (required) new password to set for member; must match password_confirmation
password_confirmation string (required) new password to set for member; must match password

Set Member Referral Code

Set an existing member referral code.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/referral_code

Returns JSON of successful response

{
  "success": true
}

Return JSON if member already used a referral code

{
  "code": 4502,
  "name": "already_referred",
  "message": "You already submitted a referral code."
}

Return JSON if invalid referral code

{
  "code": 4500,
  "name": "not_available",
  "message": "Referral code is invalid."
}

Return JSON if referral code is owned by the same member

{
  "code": 4504,
  "name": "self_referral",
  "message": "You are not allowed to use your own referral code."
}

HTTP Request

PUT <base_url>/program/api/members/<id>/referral_code

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id to set referral
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
referral_code string (required) referral_code shared by other member

Get Member Summary

Get summary details about an existing member.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<member_id>/summary

Returned JSON

{
  "success": true,
  "data": {
    "member": {
      "first_name": "Japhet",
      "last_name": "Shem",
      "member_id": "B-0000000400",
      "member_since": "2016-11-16T00:00:00.000Z",
      "referred": false,
      "visitor": false
    },
    "tier": {
      "current_tier": {
        "name": "beginner",
        "label": "Beginner",
        "expiration_date": ""
      },
      "tier_in_progression": "Beginner",
      "primary_metric_name": "walks",
      "metrics": [
        "runs"
      ],
      "expressions_exist": false,
      "tiers": [
        {
          "id": 1,
          "name": "beginner",
          "label": "Beginner",
          "description": "",
          "metric_thresholds": {
            "runs": 0
          }
        }
      ]
    },
    "metrics": {
      "walks": {
        "label": "Walks",
        "balance": "0",
        "life_time": "0",
        "last_12mo": "0",
        "ytd": "0",
        "last_30d": "0",
        "mtd": "0",
        "today": "0",
        "redeem_total": "0"
      },
      "runs": {
        "label": "Runs",
        "balance": "0",
        "life_time": "0",
        "last_12mo": "0",
        "ytd": "0",
        "last_30d": "0",
        "mtd": "0",
        "today": "0",
        "redeem_total": "0"
      }
    },
    "member_badges": [],
    "permissions": null
  }
}

Returned JSON when specified member_attribues only, i.e. member_attribues: ['member_id', 'member_since']

{
  "success": true,
  "data": {
    "member": {
      "member_id": "B-0000000400",
      "member_since": "2016-11-16T00:00:00.000Z"
    }
  }
}

Returned JSON when specified metric only, i.e. metric: 'points'

{
  "success":true,
  "data":{
    "metrics":{
      "points":{
        "label":"Points",
        "balance":"0",
        "life_time":"0",
        "last_12mo":"0",
        "ytd":"0",
        "last_30d":"0",
        "mtd":"0",
        "today":"0",
        "redeem_total":"0"
      }
    }
  }
}

Returned JSON when specified metric only with attribute, i.e. metric: 'points:balance'

{
  "success":true,
  "data":{
    "metrics":{
      "points":{
        "balance":"0"
      }
    }
  }
}

HTTP Request

GET <base_url>/program/api/members/<member_id>/summary

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
member_id string (required) member_id of member to lookup
access_token string (required) access_token from successful login
member_attributes string (optional) Array of member_attributes to return in 'member' node
metric string (optional) Specify metric to return in 'metrics' node

Get Member Pipeline Summary

Get pipeline summary details about an existing member.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "member_id=<member_id>"
     <base_url>/program/api/pipeline/cw/summary

Returned JSON

{
  "success": true,
  "data": {
    "member": {
      "first_name": "Chuck",
      "last_name": "Norris",
      "member_id": "A-0000002",
      "card_id": null,
      "mobile": 6501987654,
      "member_since": "2015-06-22T00:00:00.000Z"
    },
    "progress": {
      "tours_completed": 0,
      "tours_completed_credit": 1,
      "wbt_credits": 88,
      "wbt_next_threshold": 100,
      "wbt_next_reward": "$15 OC Cash Reward",
      "points": 20,
      "points_next_threshold": 75,
      "points_next_reward": "$5 OC Cash"
    },
    "rewards": [
      {
        "name": "Free Appetizer",
        "description": "Welcome reward - free appetizer upto $12",
        "start_date": "2017-04-01T00:00:00.000Z",
        "end_date": "2017-04-01T00:00:00.000Z",
        "category": "food",
        "balance": null,
        "image_url": "https://s3.../contents/images/000/005/399/standard/__35.JPG?1449109087",
        "thumb_image_url": "https://s3.../contents/images/000/005/399/thumb/__35.JPG?1449109087"
      },
      {
        "name": "$5 OC Cash",
        "description": "$5 OC Cash \"reward\" that has to be used in one go (balance does not carry forward)",
        "start_date": "2017-04-01T00:00:00.000Z",
        "end_date": "2017-04-01T00:00:00.000Z",
        "category": "oc_cash",
        "balance": null,
        "image_url": "https://s3.../contents/images/000/005/399/standard/__35.JPG?1449109087",
        "thumb_image_url": "https://s3.../contents/images/000/005/399/thumb/__35.JPG?1449109087"
      },
      {
        "name": "$15 OC Cash Reward",
        "description": "some description",
        "start_date": "2017-04-01T00:00:00.000Z",
        "end_date": "2017-04-01T00:00:00.000Z",
        "category": "oc_cash_reward_1",
        "balance": 10.75,
        "image_url": "https://s3.../contents/images/000/005/399/standard/__35.JPG?1449109087",
        "thumb_image_url": "https://s3.../contents/images/000/005/399/thumb/__35.JPG?1449109087"
      },
      {
        "name": "$25 OC Cash Reward",
        "description": "some description",
        "start_date": "2017-04-01T00:00:00.000Z",
        "end_date": "2017-04-01T00:00:00.000Z",
        "category": "oc_cash_reward_2",
        "balance": 25,
        "image_url": "https://s3.../contents/images/000/005/399/standard/__35.JPG?1449109087",
        "thumb_image_url": "https://s3.../contents/images/000/005/399/thumb/__35.JPG?1449109087"
      }
    ],
    "punchcards": [
      {
        "name": "Tour 1 to 10 - Recognition",
        "description": "some description",
        "start_date": null,
        "end_date": null,
        "category": "wbt_recognition",
        "required_punches": 110,
        "num_punches": 3,
        "punches": [
          "9901",
          "9902",
          "9903"
        ],
        "image_url": "https://s3.../contents/images/000/005/399/standard/__35.JPG?1449109087",
        "thumb_image_url": "https://s3.../contents/images/000/005/399/thumb/__35.JPG?1449109087"
      },
      {
        "name": "Tour 2 Plus Credit",
        "description": "some description",
        "start_date": null,
        "end_date": null,
        "category": "wbt_credit",
        "required_punches": 110,
        "num_punches": 3,
        "punches": null,
        "image_url": "https://s3.../contents/images/000/005/399/standard/__35.JPG?1449109087",
        "thumb_image_url": "https://s3.../contents/images/000/005/399/thumb/__35.JPG?1449109087"
      },
      {
        "name": "Summer Mini Tour",
        "description": "some description",
        "start_date": "2017-05-01T00:00:00.000Z",
        "end_date": "2017-05-31T00:00:00.000Z",
        "category": "minitours",
        "required_punches": 10,
        "num_punches": 2,
        "punches": [
          "9902",
          "9903"
        ],
        "image_url": "https://s3.../contents/images/000/005/399/standard/__35.JPG?1449109087",
        "thumb_image_url": "https://s3.../contents/images/000/005/399/thumb/__35.JPG?1449109087"
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/pipeline/cw/summary

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
member_id string *(optional) member_id of member to lookup
card_id string *(optional) card_id of member to lookup
email string *(optional) email of member to lookup
integration_id string *(optional) integration_id of member to lookup

Get Member Activities

Get the activity history for a member.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/activities

Returned JSON

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "period_start": "",
    "period_end": "",
    "activities": [
      {
        "activity_ts": "2015-12-01T09:36:04.805Z",
        "type_name": "sl_member_attribute",
        "type_label": "Update Member Attribute",
        "metric_name": "point",
        "metric_label": "Point",
        "metric_amount": "0",
        "label": "",
        "detail": ""
      },
      {
        "activity_ts": "2015-12-01T03:14:16.670Z",
        "type_name": "sl_challenge",
        "type_label": "Challenge Response",
        "metric_name": "point",
        "metric_label": "Point",
        "metric_amount": "100",
        "label": "Photo Challenge",
        "detail": ""
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/members/<id>/activities

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member
activity_types (optional) List of activity_types to retrieve
period_start string (optional) Retrieve activities specified by period_start datetime string
period_end string (optional) Retrieve activities specified by period_end datetime string
with_details boolean (optional) Return activities with details; default is false
with_line_item boolean (optional) Return activity line items; default is true
with_metric_change boolean (optional) Return activities with metric changes; default is true
page integer (optional) page number offset
per_page integer (optional) Number of activities per page; default is 15
access_token string (required) access_token from successful login

Get Member Receipts

Get the receipts for a member.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/receipts

Returned JSON

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "receipts": [
      {
        "id": 110,
        "created_at": "2016-04-27T07:03:21.000Z",
        "updated_at": "2016-04-27T07:03:21.000Z",
        "created_by": "Stellar Boy",
        "last_updated_by": "System",
        "receipt_url": "https://s3.amazonaws.com/DSC_0275.JPG?1461740600",
        "or_number": "1234",
        "or_date": "2016-04-27T15:03:00.000Z",
        "vendor": "walmart",
        "status": "submitted",
        "outcome": "none",
        "amount_paid": "100.0",
        "metric_amount": "0.0",
        "activity_submitted": false,
        "metric_name": "point",
        "uploaded_via": "email",
        "processing_type": "manual",
        "comment": null
      },
      {
        "id": 64,
        "created_at": "2016-02-11T10:47:11.000Z",
        "updated_at": "2016-02-11T10:48:28.000Z",
        "created_by": "System",
        "last_updated_by": "System",
        "receipt_url": "https://s3.amazonaws.com/amazon_receipt.png?1455187631",
        "or_number": null,
        "or_date": null,
        "vendor": null,
        "status": "completed",
        "outcome": "failed_unsupported_vendor",
        "amount_paid": "0.0",
        "metric_amount": "0.0",
        "activity_submitted": true,
        "metric_name": "point",
        "uploaded_via": "web",
        "processing_type": "manual",
        "comment": null
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/members/<id>/receipts

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member
access_token string (required) access_token from successful login

Get Member Rewards

Get rewards member can respond to.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/rewards

Returned JSON

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "rewards": [
      {
        "id": 7,
        "type": "product",
        "sku": "HS00345",
        "draw_date": null,
        "points": "0",
        "metric_amount": "0",
        "metric": "point",
        "metric_name": "point",
        "metric_display_name": "Points",
        "start_date": null,
        "end_date": null,
        "heading": "Great Headset",
        "subheading": "",
        "body": "",
        "details": "",
        "image_url": "",
        "thumb_image_url": "",
        "original_image_url": "",
        "action": "",
        "heading_color": "",
        "color": null,
        "bgcolor": null,
        "heading_bgcolor": "",
        "image1_bg": null,
        "layout_id": "ios",
        "awarded": false,
        "favorited": false,
        "redeemable": true,
        "respondable": true,
        "target_url": "",
        "internal_url": "reward://7",
        "address_required": true
      },
      {
        "id": 178,
        "type": "contest",
        "sku": null,
        "draw_date": null,
        "points": "0",
        "metric_amount": "0",
        "metric": "point",
        "metric_name": "point",
        "metric_display_name": "Points",
        "start_date": null,
        "end_date": null,
        "heading": "Shem Contest",
        "subheading": null,
        "body": null,
        "details": null,
        "image_url": "",
        "thumb_image_url": "",
        "original_image_url": "",
        "action": null,
        "heading_color": null,
        "color": null,
        "bgcolor": null,
        "heading_bgcolor": null,
        "image1_bg": null,
        "layout_id": "ios",
        "awarded": false,
        "favorited": false,
        "redeemable": true,
        "respondable": true,
        "target_url": null,
        "internal_url": null,
        "address_required": false
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/members/<id>/rewards

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (optional) id or member_id to lookup
integration_id string (optional) integration id to lookup
card_id string (optional) card id to lookup
access_token string (required) access_token from successful login
sort string (optional) Sort options. Values: label updated_at created_at
Default: update_date desc

Get Member Redemptions

Get the reward redemptions for a member.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/rewards/responses

Returned JSON

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "responses": [
      {
        "id": 7,
        "redemption_status": "completed",
        "member_name": "Ronald Silang",
        "member_id": 18,
        "redemption_amount": "2",
        "metric_name": "point",
        "metric_display_name": "Points",
        "metric_amount": "2",
        "sku": null,
        "integration_id": null,
        "shipping_address": null,
        "image_url": "https://s3.amazonaws.com/qyxdn1uk2xgzssjk6wya/rewards//original/heineken-options2.jpeg?1433313816",
        "thumb_image_url": "https://s3.amazonaws.com/qyxdn1uk2xgzssjk6wya/rewards//original/heineken-options2.jpeg?1433313816",
        "redemption_unit": "point",
        "notes": [
          {
            "id": 24,
            "created_at": "2015-06-23T14:41:10.000Z",
            "updated_at": "2015-06-23T14:41:10.000Z",
            "message": "Out of stock",
            "visible": true
          }
        ],
        "created_at": "2015-06-09T04:33:15.000Z",
        "updated_at": "2016-05-23T06:28:59.000Z",
        "reward": {
          "id": 1,
          "type": "product",
          "sku": "89123-128736",
          "draw_date": null,
          "points": "2",
          "metric_amount": "2",
          "metric": "point",
          "metric_name": "point",
          "metric_display_name": "Points",
          "start_date": null,
          "end_date": null,
          "heading": "JJ REWARDS Detail",
          "subheading": "",
          "body": "",
          "details": "",
          "image_url": "https://s3.amazonaws.com/heineken-options2.jpeg?1433313816",
          "thumb_image_url": "https://s3.amazonaws.com/original/heineken-options2.jpeg?1433313816",
          "original_image_url": "https://s3.amazonaws.com//original/heineken-options2.jpeg?1433313816",
          "action": "",
          "heading_color": "",
          "color": null,
          "bgcolor": null,
          "heading_bgcolor": "",
          "image1_bg": null,
          "layout_id": "ios",
          "awarded": false,
          "favorited": true,
          "redeemable": true,
          "respondable": true,
          "target_url": "",
          "internal_url": "reward://1",
          "address_required": true
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/members/<member_id>/rewards/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member
access_token string (required) access_token from successful login
sort string (optional) Sort options. Values: created_at updated_at member_full_name sku redemption_status exported_at imported_at
Default: update_date desc

Get Member Offers

Get the offers for a member.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/offers

Returned JSON

{
    "success": true,
    "data": {
        "total_pages": 1,
        "total_entries": 1,
        "offers": [
            {
                "id": 279,
                "internal_name": "seb_s_use_case",
                "type": "certificate",
                "description": null,
                "rank": null,
                "campaign_id": null,
                "campaign_rank": null,
                "aggregated_business_value": "0.0",
                "start_date": null,
                "end_date": null,
                "response_start_date": null,
                "response_end_date": null,
                "response_schedule": null,
                "trigger_activity_type": null,
                "heading": "Seb's Use Case",
                "subheading": "",
                "body": "",
                "subject": "",
                "details": "",
                "action": "",
                "heading_color": "",
                "color": "",
                "bgcolor": "",
                "heading_bgcolor": "",
                "image1_bg": "",
                "layout_id": "master",
                "image_url": "https://s3.us-east-1.amazonaws.com/stellar-growingtree-qyxdn1uk2xgzssjk6wya/contents/9034/static_files/baubel.png?1553594515",
                "thumb_image_url": "https://s3.us-east-1.amazonaws.com/stellar-growingtree-qyxdn1uk2xgzssjk6wya/contents/9034/static_files/baubel.png?1553594515",
                "original_image_url": "https://s3.us-east-1.amazonaws.com/stellar-growingtree-qyxdn1uk2xgzssjk6wya/contents/9034/static_files/baubel.png?1553594515",
                "favorited": false,
                "respondable": true,
                "respondable_info": {
                    "value": true,
                    "code": "",
                    "message": ""
                },
                "target_url": "https://growingtree.demostellar.com/is?p=JUeyJyZW5kZXJUbyI6IiNzb2NpYWxzaGFyZSIsImltZ1NlbGVjdG9yIjoiLnNob3ctaW1hZ2UgaW1nIiwicHJvZ19pZCI6MSwiY29tcF90eXBlIjoib2ZmZXIiLCJjb21wX2lkIjoyNzksInRpdGxlIjoiU2ViJ3MgVXNlIENhc2UiLCJkZXNjcmlwdGlvbiI6IiIsInNpdGVfbmFtZSI6Ikdyb3dpbmcgVHJlZSIsImltZyI6Imh0dHBzOi8vczMudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vc3RlbGxhci1ncm93aW5ndHJlZS1xeXhkbjF1azJ4Z3pzc2prNnd5YS9jb250ZW50cy9pbWFnZXMvMDAwLzAwOS8wMzQvc3RhbmRhcmQvYmF1YmVsLnBuZz8xNTUzNTk0NTE2IiwiZnVsbEltZyI6Imh0dHBzOi8vczMudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vc3RlbGxhci1ncm93aW5ndHJlZS1xeXhkbjF1azJ4Z3pzc2prNnd5YS9jb250ZW50cy9pbWFnZXMvMDAwLzAwOS8wMzQvb3JpZ2luYWwvYmF1YmVsLnBuZz8xNTUzNTk0NTE2Iiwic2hvd19zdG9yeSI6dHJ1ZSwibHBfdHlwZSI6ImZhY2Vib29rIn0=",
                "internal_url": "offer://279",
                "tracking_code": null,
                "metric_amount": "0.0",
                "metric_name": "points",
                "acceptance_required": false,
                "acceptance_text": "",
                "acceptance_url": null
            }
        ]
    }
  }

HTTP Request

GET <base_url>/program/api/members/<id>/offers

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of member to query
access_token string (required) access_token from successful login
set string (optional) Internal name of a known Offer Set
placement string (optional) Internal name of a known Placement
campaign string (optional) Internal name of a known Campaign
offer_type string (optional) Return only matching offer_types based on offer_type parameter. Can be any of 'barcode', 'certificate', 'coupon', 'url' or 'stellar'.
start_index Integer (optional) Start index of the available Offers subset. Used in conjunction with set.
end_index Integer (optional) End index of the available Offers subset. Used in conjunction with set.
category string (optional) key from the list of Offer Categories
layout string (optional) The content layout name. Default is the access token's application name. Example: ios, android
Sorting Param
sort_by string (optional) Sort options. Values can be updated_at or publish_date or name or points. default: updated_at
sort_dir string (optional) Sort direction. Values can be desc or asc. default: desc. NOTE: default is desc if sort_by is date otherwise asc
page numeric (optional) Offset page parameter
per_page numeric (optional) Number of items per page
Filter Param
respondable boolean (optional) If set to true, only offers that can be responded to will be shown. (Default: false)
show_clipped boolean (optional) If set to true, will show clipped and unclipped offers, false will show unclipped offers only (Default: false)
show_target boolean (optional) If set to true, targetable attribute that holds a target offer object will be shown. (Default: false)
displayable_processing_statuses string (optional) Comma-separated string of category internal names of Offers to include in the response
category string (optional) Comma-separated string of category internal names of Offers to include in the response
Extra Detail Param These parameters add extra details and has performance overhead. Please use sparingly.
include_clipped boolean (optional) If set to true, is_clipped attribute will be shown. (Default: false)
include_responses boolean (optional) If set to true, responses(Array) attribute that holds responses details will be shown. (Default: false)
result_with_categories boolean (optional) Values can be true or false. This parameter will return the category keys of the offer in an array.
html boolean (optional) If set to true, html attribute that holds html layout will be shown. (Default: false)

Get Member Offer Responses

Get the offer responses for a member.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/offers/responses

Returned JSON

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 21,
    "responses": [
      {
        "id": 255,
        "respondable": true,
        "processing_status": "pending",
        "usage_start_date": null,
        "usage_end_date": null,
        "usage_schedule": null,
        "created_at": "2020-03-13T03:44:58.000Z",
        "updated_at": "2020-03-13T03:44:58.000Z",
        "order_transaction_id": "5",
        "offer": {
          "id": 68,
          "internal_name": "plum_markets_12",
          "integration_id": "359146",
          "type": "coupon",
          "description": null,
          "rank": null,
          "campaign_id": null,
          "campaign_score": null,
          "campaign_rank": null,
          "aggregated_business_value": "0.0",
          "start_date": null,
          "end_date": null,
          "response_start_date": null,
          "response_end_date": null,
          "response_schedule": null,
          "trigger_activity_type": null,
          "heading": "Plum Markets",
          "subheading": "",
          "body": "",
          "subject": "",
          "details": "",
          "action": "",
          "heading_color": "",
          "color": "",
          "bgcolor": "",
          "heading_bgcolor": "",
          "image1_bg": "",
          "layout_id": "master",
          "image_url": "/images/standard/missing.png",
          "thumb_image_url": "/images/thumb/missing.png",
          "original_image_url": "/images/original/missing.png",
          "favorited": false,
          "respondable": true,
          "respondable_info": {
            "value": true,
            "code": "",
            "message": ""
          },
          "extra_json": {},
          "target_url": "http://localhost:8080/is?p=JUeyJyZW5kZXJUbyI6IiNzb2NpYWxzaGFyZSIsImltZ1NlbGVjdG9yIjoiLnNob3ctaW1hZ2UgaW1nIiwicHJvZ19pZCI6MSwiY29tcF90eXBlIjoib2ZmZXIiLCJjb21wX2lkIjo2OCwidGl0bGUiOiJQbHVtIE1hcmtldHMiLCJkZXNjcmlwdGlvbiI6bnVsbCwic2l0ZV9uYW1lIjoiVW50aXRsZWQgUHJvZ3JhbSIsImltZyI6Ii9pbWFnZXMvc3RhbmRhcmQvbWlzc2luZy5wbmciLCJmdWxsSW1nIjoiL2ltYWdlcy9vcmlnaW5hbC9taXNzaW5nLnBuZyIsInNob3dfc3RvcnkiOnRydWUsImxwX3R5cGUiOiJmYWNlYm9vayJ9",
          "internal_url": "offer://68",
          "tracking_code": null,
          "metric_amount": "0.0",
          "metric_name": "punto",
          "acceptance_required": false,
          "acceptance_text": "",
          "acceptance_url": null
        },
        "coupon": {
          "code": null,
          "barcode": null,
          "barcode_std": "inmar"
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/members/<id>/offers/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member
access_token string (required) access_token from successful login
Parameter Type Description
access_token string (required) access_token from successful login
Filter Param
category string (optional) Comma-separated string of category internal names of Offers to include in the response
usable boolean (optional) Removes unusable responses if true. Defaults tofalse`, i.e. do not filter
processing_status string (optional) Filter results depending on the requested processing_status. Values can be one of ["pending", "clipped", "processing", "shipping", "completed", "cancelled", "errored", "expired"]
placement string (optional) Return only responses from requested Placement. Value is the internal name of the Placement.
filter_inactive_parents boolean (optional) Removes responses that belong to inactive offers if true. Defaults to true
Extra Detail Param These parameters add extra details and has performance overhead. Please use sparingly.
include_clipped boolean (optional) If set to true, is_clipped attribute will be shown. (Default: false)
result_with_categories boolean (optional) Values can be true or false. This parameter will return the category keys of the offer in an array.
include_granting_object boolean (optional) Include the source of the response if true. Defaults to false
Sorting Param
sort_by string (optional) Sort options. Values can be updated_at or publish_date or name or points. default: updated_at
sort_dir string (optional) Sort direction. Values can be desc or asc. default: desc. NOTE: default is desc if sort_by is date otherwise asc
page numeric (optional) Offset page parameter
per_page numeric (optional) Number of items per page

Clip/Unclip an Offer Response

Allows the user to clip/unclip an offer response.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/offers/responses/<offer_response_id>/clip
curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/offers/responses/<offer_response_id>/clip

Returned JSON

{
    "success": true
}

HTTP Request

POST <base_url>/program/api/members/<id>/offers/responses/<offer_response_id>/clip

DELETE <base_url>/program/api/members/<id>/offers/responses/<offer_response_id>/clip

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member
offer_response_id string (required) id of offer response
access_token string (required) access_token from successful login

Clip/Unclip an Offer

Allows the user to clip/unclip an offer.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/offers/<offer_id>/clip
curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/offers/<offer_id>/clip

Returned JSON

{
    "success": true
}

HTTP Request

POST <base_url>/program/api/members/<id>/offers/<offer_id>/clip

DELETE <base_url>/program/api/members/<id>/offers/<offer_id>/clip

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member
offer_id string (required) id of offer
access_token string (required) access_token from successful login

Clip/Unclip a Member Gift card

To clip a gift card via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/giftcards/<card_number>/clip

To unclip a gift card via command line, invoke the following cURL command:

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/giftcards/<card_number>/clip

Successful clipping returns JSON structured like this:

{
  "success": true,
    "data": {
      "card_number": "12345678",
      "active": true,
      "clipped": true,
      "name": "",
      "description": "",
      "balance": "0.00",
      "currency": "USD",
      "usage_start_date": null,
      "usage_end_date": null,
      "usage_schedule": null,
      "class": {
          "title": "Default Class",
          "label": "Default Class",
          "name": "default_class",
          "response_start_date": null,
          "response_end_date": null,
          "response_schedule": null,
          "heading": "Default Class",
          "subheading": "",
          "body": "",
          "subject": "",
          "details": "",
          "action": "",
          "heading_color": "",
          "color": "",
          "bgcolor": "",
          "heading_bgcolor": "",
          "image1_bg": "",
          "layout_id": "master",
          "image_url": "/images/standard/missing.png",
          "thumb_image_url": "/images/thumb/missing.png",
          "original_image_url": "/images/original/missing.png",
          "respondable": true,
          "respondable_info": {
              "value": true,
              "code": "",
              "message": ""
          }
      },
      "auto_reload": true,
      "reload_threshold": "300.00",
      "reload_amount": "100.00",
      "reload_description": null
    }
}

Successful unclipping returns JSON structured like this:

{
  "success": true,
    "data": {
      "card_number": "12345678",
      "active": true,
      "clipped": false,
      "name": "",
      "description": "",
      "balance": "0.00",
      "currency": "USD",
      "usage_start_date": null,
      "usage_end_date": null,
      "usage_schedule": null,
      "class": {
          "title": "Default Class",
          "label": "Default Class",
          "name": "default_class",
          "response_start_date": null,
          "response_end_date": null,
          "response_schedule": null,
          "heading": "Default Class",
          "subheading": "",
          "body": "",
          "subject": "",
          "details": "",
          "action": "",
          "heading_color": "",
          "color": "",
          "bgcolor": "",
          "heading_bgcolor": "",
          "image1_bg": "",
          "layout_id": "master",
          "image_url": "/images/standard/missing.png",
          "thumb_image_url": "/images/thumb/missing.png",
          "original_image_url": "/images/original/missing.png",
          "respondable": true,
          "respondable_info": {
              "value": true,
              "code": "",
              "message": ""
          }
      },
      "auto_reload": true,
      "reload_threshold": "300.00",
      "reload_amount": "100.00",
      "reload_description": null
    }
}

HTTP Request

POST <base_url>/program/api/members/<id>/giftcards/<card_number>/clip

DELETE <base_url>/program/api/members/<id>/giftcards/<card_number>/clip

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
card_number string (required) card_number of gift card

Get Member Redemption

Get the reward redemption for a member.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<id>/rewards/responses/<redemption_id>

Returned JSON

{
  "success": true,
  "data": {
    "id": 7,
    "redemption_status": "completed",
    "member_name": "Ronald Silang",
    "member_id": 18,
    "redemption_amount": "2",
    "metric_name": "point",
    "metric_display_name": "Points",
    "metric_amount": "2",
    "sku": null,
    "integration_id": null,
    "shipping_address": null,
    "image_url": "https://s3.amazonaws.com/qyxdn1uk2xgzssjk6wya/rewards//original/heineken-options2.jpeg?1433313816",
    "thumb_image_url": "https://s3.amazonaws.com/qyxdn1uk2xgzssjk6wya/rewards//original/heineken-options2.jpeg?1433313816",
    "redemption_unit": "point",
    "notes": [
      {
        "id": 24,
        "created_at": "2015-06-23T14:41:10.000Z",
        "updated_at": "2015-06-23T14:41:10.000Z",
        "message": "Out of stock",
        "visible": true
      }
    ],
    "created_at": "2015-06-09T04:33:15.000Z",
    "updated_at": "2016-05-23T06:28:59.000Z",
    "reward": {
      "id": 1,
      "type": "product",
      "sku": "89123-128736",
      "draw_date": null,
      "points": "2",
      "metric_amount": "2",
      "metric": "point",
      "metric_name": "point",
      "metric_display_name": "Points",
      "start_date": null,
      "end_date": null,
      "heading": "JJ REWARDS Detail",
      "subheading": "",
      "body": "",
      "details": "",
      "image_url": "https://s3.amazonaws.com/heineken-options2.jpeg?1433313816",
      "thumb_image_url": "https://s3.amazonaws.com/original/heineken-options2.jpeg?1433313816",
      "original_image_url": "https://s3.amazonaws.com//original/heineken-options2.jpeg?1433313816",
      "action": "",
      "heading_color": "",
      "color": null,
      "bgcolor": null,
      "heading_bgcolor": "",
      "image1_bg": null,
      "layout_id": "ios",
      "awarded": false,
      "favorited": true,
      "redeemable": true,
      "respondable": true,
      "target_url": "",
      "internal_url": "reward://1",
      "address_required": true
    }
  }
}

HTTP Request

GET <base_url>/program/api/members/<member_id>/rewards/responses/<redemption_id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member
redemption_id integer (required) id of reward redemption
access_token string (required) access_token from successful login

Create Member Redemption

Create a reward redemption for a member.

This endpoint requires the ID of the member, and the reward_id of the reward to redeem.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/members/<member_id>/rewards/<reward_id>/responses

Returned JSON

{
  "success": true,
  "data": {
    "reward_response": {
      "id": 547
    },
    "reward_respondable": true
  }
}

HTTP Request

POST <base_url>/program/api/members/<member_id>/rewards/<reward_id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id to create response
reward_id string (required) reward_id of reward to respond to in behalf of the member
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
combination_id integer (optional) The combination of attributes id from the reward_configuration in Get Reward
award_id integer (optional) The award id from Reward Awards.
Using an unclaimed award create redemption using member points

Aside from the above parameters, you need to pass either an address id or create a new address.

Parameter Type Description
address_id integer (required) The member's valid address id from Member Addresses

or

Parameter Type Description
address[street_address] string (required) The member's street address
address[city] string (required) The member's city address
address[state] string (optional) The member's state address
address[country_code] string (required) The member's country code address
address[zip_code] string (optional) The member's zip code address

Update Member Redemption

Update a reward redemption for a member.

This endpoint requires the ID of the member, and the redemption_id of the reward redemption.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "redemption_status=processing"
     <base_url>/program/api/members/<member_id>/rewards/responses/<redemption_id>

Returned JSON

{
  "success": true,
  "data": {
    "id": 10,
    "redemption_status": "processing",
    "member_name": "Lexi Treutel",
    "member_id": 8,
    "redemption_amount": "50",
    "metric_name": "point",
    "metric_display_name": "",
    "metric_amount": "50",
    "sku": null,
    "integration_id": "A-12345",
    "shipping_address": null,
    "image_url": "/images/standard/missing.png",
    "thumb_image_url": "/images/thumb/missing.png",
    "redemption_unit": "point",
    "notes": [],
    "created_at": "2016-05-31T03:52:45.000Z",
    "updated_at": "2016-05-31T03:52:45.293Z",
    "reward": {
      "id": 12,
      "type": "product",
      "sku": "SKU-123",
      "draw_date": null,
      "points": "20",
      "metric_amount": "20",
      "metric": "point",
      "metric_name": "point",
      "metric_display_name": "",
      "start_date": "2016-05-29T03:52:27.000Z",
      "end_date": "2016-06-01T03:52:27.000Z",
      "heading": "driver12",
      "subheading": "",
      "body": "",
      "details": "",
      "image_url": "",
      "thumb_image_url": "",
      "original_image_url": "",
      "awarded": false,
      "favorited": false,
      "redeemable": true,
      "respondable": true,
      "reward_attributes": [],
      "reward_configuration": [],
      "target_url": null,
      "internal_url": null,
      "address_required": true
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/members/<member_id>/rewards/responses/<redemption_id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member whose redemption to update
redemption_id string (required) redemption_id to update or process
redemption_status string (optional) Values can be pending, processing, completed, cancelled or errored
access_token string (required) access_token from successful login

Delete Member Redemption

Deleting expects ID parameter.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/responses/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 4,
    "redemption_status": "pending",
    "member_name": "Arnulfo Lemke",
    "member_id": 6,
    "redemption_amount": "50",
    "metric_name": "point",
    "metric_display_name": "",
    "metric_amount": "50",
    "sku": null,
    "integration_id": "A-12345",
    "shipping_address": null,
    "image_url": "/images/standard/missing.png",
    "thumb_image_url": "/images/thumb/missing.png",
    "redemption_unit": "point",
    "notes": [],
    "created_at": "2016-05-28T03:31:19.000Z",
    "updated_at": "2016-05-28T03:31:19.000Z",
    "redemption": {
      "id": 6,
      "program_id": 3,
      "name": "hard_drive6",
      "description": "The HTTP system is down, connect the open-source pixel so we can transmit the FTP monitor!",
      "sku": "SKU-123",
      "metric_amount": "20.0",
      "response_max_per_member": null,
      "response_max_per_member_unit": null,
      "response_interval": null,
      "response_interval_unit": null,
      "response_max_overall": null,
      "response_max_overall_unit": null,
      "response_tier": null,
      "show_in_gallery": "yes",
      "show_in_redemptions": "yes",
      "allow_responses": "yes",
      "image_file_name": null,
      "image_content_type": null,
      "image_file_size": null,
      "image_updated_at": null,
      "effectivity_start": "2016-05-26T03:31:01.000Z",
      "effectivity_end": "2016-05-29T03:31:01.000Z",
      "status": "draft",
      "published_at": null,
      "created_at": "2016-05-28T03:31:19.000Z",
      "updated_at": "2016-05-28T03:31:19.000Z",
      "metric_name": "point",
      "label": "hard drive6",
      "recurring": false,
      "recurring_schedule": {},
      "template_set_version_id": 0,
      "redemption_type": "product",
      "show_to_public": false,
      "certificate_display_text": null,
      "news_feed_id": null,
      "share_on_news_feed": "manual",
      "prize_type": null,
      "prize_id": null,
      "prize_metric_amount": null,
      "prize_metric_name": null,
      "prize_frequency": null,
      "prize_probability": null,
      "properties": {
        "require_shipping_address": "yes"
      },
      "contest_draw_date": null,
      "static_files": []
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/members/<id>/rewards/responses/<redemption_id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or member_id of member
redemption_id string (required) id of redemption to delete
access_token string (required) access_token from successful login

Retro claim

To retro claim an order via command line, invoke the following cURL command:

curl -X POST \
  '<base url>/program/api/members/<id>/orders/claim?access_token=<access_token' \
  -H 'Accept: application/vnd.stellar-v1+json' \
  -F transaction_id=<transaction_id> \
  -F business_date=<business_date> \
  -F place_id=<place_id>

If successful, the response should look like this:

{
    "success": true,
    "data": {
        "claim_stub": "1af9b765-0e15-43da-9619-7635581149f1",
        "claimed_at": "2020-01-26T2:08:24.000Z",
        "metric_amount": "81",
        "metric_name": "points"
    }
}

If unsuccessful, the response will be something like:

{
    "code": 4044,
    "name": "not_available",
    "message": "Resource not available"
}

Retro claim a member order.

HTTP Request

POST <base url>/program/api/members/<member_id>/orders/claim

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
member_id string (required) member_id to retro claim
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
flow string (optional) Specifies the flow. Can be either receipt or credit_card. If left blank the default value is receipt
transaction_id string (optional) Transaction id
business_date string (required) Order Business Date (YYYY-MM-DD)
place_id string (required) Store Identifier
last_4_cc_digits string (optional) Last 4 digits of Credit Card
charged_amount string (optional)
register_name string (optional)
subtotal string (optional)
total_amount string (optional)

Respond with Code Entry

This API mirrors what is currently in the Member API https://docs.runstellar.com/en-us/edp/developer/memberapi/#codes

The submitted ticket code is the value of one of the Entries that were generated/imported for a specific Code.

Only the Code/s specified in the "Promo Codes" setting (under "Codes" section) will be considered active.

To respond to a content Code via command line, invoke the following cURL command:

curl -X POST
-H 'Accept: application/vnd.stellar-v1+json'
-F "access_token=<access_token>"
-F "value=<string value of a Code Entry>"
<base url>/program/api/members/<member_id>/codes/respond

If successful, the response should look like this:

{
    "success": true,
    "message": "Congratulations, ticket accepted.",
    "data": {
        "id": 5,
        "status": "approved",
        "approval_status": "approved",
        "respondable": false,
        "metric_name": "points",
        "metric_amount": "0.0",
        "response_message": null
    }
}

HTTP Request

POST <base url>/program/api/members/<member_id>/codes/respond

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

Query Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
value string (required) value of a Code Entry

Error Codes

Code Description
4044 Resource not available
4446 Resource already claimed
4049 Retro claim age limit error
4800 Invalid parameter format
4060 Missing required parameter

Groups

All group related operations is done under this path

<base_url>/program/api/groups

Some endpoints, such as Delete and Update, require an id parameter to identify the group. The id parameter is the group's database id.

List All Groups

Returns paginated list of groups. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/groups

Returns paginated list of groups:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 3,
    "groups": [
      {
        "id": 12,
        "group_id": "G-000000001",
        "description": null,
        "name": "enim11",
        "display_name": "enim11",
        "avatar_url": ""
      },
      {
        "id": 13,
        "group_id": "G-000000002",
        "description": null,
        "name": "debitis12",
        "display_name": "debitis12",
        "avatar_url": ""
      },
      {
        "id": 14,
        "group_id": "G-000000003",
        "description": null,
        "name": "quam13",
        "display_name": "quam13",
        "avatar_url": ""
      }
    ]
  }
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50

Search groups

Similar to list, but add parameter term. This works similar to /console/groups search form - queries against group_id and name (last_name column)

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/groups?term=eligendi8

Returns paginated list of groups:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "groups": [
      {
        "id": 9,
        "group_id": "R-000000001",
        "description": null,
        "name": "eligendi8",
        "display_name": "eligendi8",
        "avatar_url": ""
      }
    ]
  }
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
term string (required) Search term
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50

Get Group

Get group

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/groups/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 13,
    "group_id": "K-000000002",
    "description": "Ortiz",
    "name": "delectus aut assumenda",
    "display_name": "delectus aut assumenda",
    "avatar_url": ""
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of group to retrieve
access_token string (required) access_token from successful login

Create Group

This endpoint requires grouph hash of attributes.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "name=Hillard"
     -F "description=Paucek"
     -F "avatar=@path_to/file.jpg"
     <base_url>/program/api/groups

Returns all the attributes of created group.

{
  "success": true,
  "data": {
    "id": 13,
    "group_id": "K-000000002",
    "description": null,
    "name": "Hillard",
    "display_name": "Paucek",
    "avatar_url": "https://s3.com/groups/DSC_0128.JPG?1446446253"
  }
}

Failed response will return 406 code and something like:

{
  "code": 4400,
  "name": "invalid_record",
  "message": "Name has already been taken."
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
group hash (required) Hash attributes of group to create

Update Group

This endpoint requires group hash of attributes and ID of group being updated.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "name=delectus aut assumenda"
     -F "description=Ortiz"
     <base_url>/program/api/groups/<id>

Returns group updated record

{
  "success": true,
  "data": {
    "id": 13,
    "group_id": "K-000000002",
    "description": "Ortiz",
    "name": "delectus aut assumenda",
    "display_name": "delectus aut assumenda",
    "avatar_url": ""
  }
}

Failed response will return 406 code and something like:

{  
   "code":4400,
   "name":"invalid_record",
   "message":"Name has already been taken."
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
group hash (required) Hash attributes of group to update

Delete Group

Deleting expects ID parameter.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/groups/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 13,
    "group_id": "K-000000002",
    "description": "Ortiz",
    "name": "delectus aut assumenda",
    "display_name": "delectus aut assumenda",
    "avatar_url": ""
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of group to delete
access_token string (required) access_token from successful login

Segments

All segment related operations is done under this path

<base_url>/program/api/segments

Some endpoints, such as Delete and Update, require an id parameter to identify the segment. The id parameter is the segment's database id.

List All Segments

Returns paginated list of segments. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/segments

Returns paginated list of segments:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 3,
    "segments": [
      {
        "id": 1,
        "name": "receive_marketing_emails",
        "segment_type": null,
        "effectivity_start": null,
        "effectivity_end": null,
        "label": "Receive Marketing Emails",
        "description": "Suspend email is false, deactivated is false, member email is not empty, receive_marketing_emails is true, and visitor is false.",
        "static_flag": false,
        "status": "draft"
      },
      {
        "id": 2,
        "name": "receive_operational_emails",
        "segment_type": null,
        "effectivity_start": null,
        "effectivity_end": null,
        "label": "Receive Operational Emails",
        "description": "Suspend email is not false, deactivated is false, and member email is not empty.",
        "static_flag": false,
        "status": "published",
        "published_at": "2015-07-28T02:37:02.000Z"
      },
      {
        "id": 4,
        "name": "beatae2",
        "segment_type": null,
        "effectivity_start": "2015-07-26T13:12:00.000Z",
        "effectivity_end": "2016-04-29T13:12:00.000Z",
        "label": "beatae2",
        "description": null,
        "static_flag": false,
        "status": "published",
        "published_at": "2016-01-18T06:14:49.000Z"
      }
    ]
  }
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
sort string (optional) Sort options. Values: label updated_at created_at
Default: update_date desc
ids array(integer) (optional) Array of DB IDs. Default: [].
names array(string) (optional) Array of internal names. Default: [].
status array(string) (optional) Array of publishing statuses. Values: draft published archived
Default: []
scope string (optional) Name of known segment scope. Values: hive golden_record legacy external non_external

Search Segments

Similar to list, but add parameter term. This works similar to /console/segments search form - queries against label name status segment_type tags_name.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/segments?term=receive_marketing_emails

Returns paginated list of segments:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "segments": [
      {
        "id": 1,
        "name": "receive_marketing_emails",
        "segment_type": null,
        "effectivity_start": "2015-07-26T13:12:00.000Z",
        "effectivity_end": "2016-04-29T13:12:00.000Z",
        "label": "Receive Marketing Emails",
        "description": "Suspend email is false, deactivated is false, member email is not empty, receive_marketing_emails is true, and visitor is false.",
        "static_flag": false,
        "status": "published",
        "published_at": "2016-01-18T06:14:49.000Z"
      }
    ]
  }
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
term string (required) Search term
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
ids array(integer) (optional) Array of DB IDs. Default: [].
names array(string) (optional) Array of internal names. Default: [].
status array(string) (optional) Array of publishing statuses. Values: draft published archived
Default: []
scope string (optional) Name of known segment scope. Values: hive golden_record legacy external non_external

Get Segment

Get an existing segment.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/segments/<id>

Returns all the attributes of segment.

{
   "success":true,
   "data":{
      "id":7,
      "name":"suscipit5",
      "label":"suscipit5",
      "description":"",
      "is_static":false,
      "conditions":[],
      "members_included":[],
      "members_excluded":[],
      "status": "draft"
   }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

Header Parameters

Parameter Type Value
id string (required) id of segment to retrieve
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Create Segment

This endpoint requires segment hash of attributes.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "name=suscipit5"
     -F "label=suscipit5"
     -F "description=Sapiente illo quia fugiat cumque."
     <base_url>/program/api/segments

Returns all the attributes of created segment.

{
   "success":true,
   "data":{
      "id":7,
      "name":"suscipit5",
      "label":"suscipit5",
      "description":"",
      "is_static":false,
      "conditions":[],
      "members_included":[],
      "members_excluded":[],
      "status": "published",
      "published_at": "2016-01-18T06:14:49.000Z"
   }
}

Failed response will return 406 code and something like:

{
   "code":4400,
   "name":"invalid_record",
   "message":"Name already taken."
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Update Segment

Update an existing segment.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "name=et1"
     -F "description=Sapiente illo quia fugiat cumque."
     <base_url>/program/api/segments/<id>

Returns segment updated record

{
   "success":true,
   "data":{
      "id":3,
      "name":"et1",
      "label":"eos",
      "description":"",
      "is_static":false,
      "conditions":[],
      "members_included":[
         "E-000000001"
      ],
      "members_excluded":[
         "E-000000002"
      ],
      "status": "draft"
   }
}

Failed response will return 406 code and something like:

{
   "code":4400,
   "name":"invalid_record",
   "message":"Name already taken."
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Delete Segment

Deleting expects ID parameter.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/segments/<id>

Returns simple JSON

{
   "success":true,
   "data":{
      "id":8,
      "name":"provident6",
      "label":"provident6",
      "description":"",
      "is_static":false,
      "conditions":[],
      "members_included":[],
      "members_excluded":[],
      "status": "draft"
   }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of segment to delete
access_token string (required) access_token from successful login

Get Segment Member Overrides

List segment members overrides

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/segments/<id>/members/overrides

Returned JSON

{
  "success": true,
  "data": {
    "included": [
      {
        "id": 28,
        "email": "nick_mccullough28@nitzsche.org",
        "member_id": "M-000000001",
        "first_name": "Enrico",
        "last_name": "Monahan",
        "integration_id": null,
        "card_id": null
      }
    ],
    "excluded": [
      {
        "id": 29,
        "email": "doris29@ziemann.name",
        "member_id": "M-000000002",
        "first_name": "Enrico",
        "last_name": "Monahan",
        "integration_id": null,
        "card_id": null
      }
    ]
  }
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of segment

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Add Segment Member Override

Create segment members override, either as 'included' or 'excluded'. Returns error if member is already part of either 'included' or 'excluded' or type value is invalid.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "member_id=<member_id>"
     -F "type=<type>"
     <base_url>/program/api/segments/<id>/members/overrides

Returned JSON

{
  "success": true,
  "data": {
    "member": {
      "id": 27,
      "email": "camryn27@moenveum.org",
      "member_id": "O-000000003",
      "first_name": "Adah",
      "last_name": "Gutmann",
      "integration_id": null,
      "card_id": null
    },
    "override": "included"
  }
}

Returned JSON if 'type' is neither 'include' or 'exclude'

{
  "code": 4060,
  "name": "invalid_params",
  "message": "'type' can only be either 'include' or 'exclude'"
}

Returned JSON if member is already part of either 'included' or 'excluded'

{
  "code": 4045,
  "name": "invalid_record",
  "message": "Validation failed: Member has already been taken"
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of segment

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
member_id string (required) member_id of member
type string (required) type of override, either 'exclude' or 'include', default is 'include'

Remove Member Override

Remove member from segment members override. Returns an error if member to be removed is not part of either 'included' or 'excluded' members.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/segments/<id>/members/overrides/<member_id>

Returned JSON

{
  "success": true,
  "data": [
    {
      "id": 28,
      "email": "valentina28@schamberger.info",
      "member_id": "Y-000000001",
      "first_name": "Linda",
      "last_name": "Bernhard",
      "integration_id": null,
      "card_id": null
    }
  ]
}

Returned JSON when removing a member that is not part of 'included' or 'excluded' segments.

{
  "code": 4060,
  "name": "invalid_params",
  "message": "Member not part of this segment"
}

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of segment
member_id string (required) member_id of member

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

SSO

These endpoints can create a member or a visitor. A visitor is also a member that has visitor flag set to true.

Create or Update a Member

This endpoint creates or updates a member and returns access_token that can be used under Member APIs.

To create or update a member via SSO with access_token, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "integration_id=<integration_id>"
     -F "mobile_phone=<mobile_phone>"
     -F "first_name=<first_name>"
     -F "last_name=<last_name>"
     -F "email=<email>"
     <base_url>/program/api/sso

Returned JSON

{
  "member_d": "A-000000001",
  "integration_id": "345678199202",
  "access_token": "5d0c438a28d62466ef70154bf15a6cc185e0e884b06d76fbf176ff86a55860c5",
  "refresh_token": "40e4726e5263ce266058c04494d4385f36530d233ef0bc363e92b2c969ff57a9"
}

To create or update a member via SSO with pair of client_id and client_secret, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "client_id=<client_id>"
     -F "client_secret=<client_secret>"
     -F "integration_id=<integration_id>"
     -F "mobile_phone=<mobile_phone>"
     -F "first_name=<first_name>"
     -F "last_name=<last_name>"
     -F "email=<email>"
     -F "preferences.phones[]=ios"
     -F "preferences.phones[]=android"
     -F "preferences.music=jazz"
     <base_url>/program/api/sso

Returned JSON

{
  "member_d": "A-000000001",
  "integration_id": "345678199202",
  "access_token": "5d0c438a28d62466ef70154bf15a6cc185e0e884b06d76fbf176ff86a55860c5",
  "refresh_token": "40e4726e5263ce266058c04494d4385f36530d233ef0bc363e92b2c969ff57a9"
}

Note: The returned access_token here is for Member APIs.

HTTP Request

POST <base_url>/program/api/sso

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters using access_token

Parameter Type Description
access_token string (required) access_token from successful authentication.

Form Parameters using access_token

Parameter Type Description
• integration_id string (required) integration_id from external system
email string (required) Member email address
first_name string (required) Member first name
last_name string (required) Member last name
mobile_phone string (optional) mobile_phone of member from external system
referral_code string (optional) If submitted and valid, creates referral link to referral_code code owner and the new member created
sso_target_client_id string (optional) Request a specified Oauth Client ID as issuer of member access_token. Make sure OAuth Application has member scope. Default will be javascript Member OAuth Application if not submitted, or non-matching client_id
preferences.<name> string/array (optional) name should match published member preferences. Note: A member preference could be a string or an array of strings based on is_multi_select flag.

Form Parameters using client_id and client_secret

Parameter Type Description
client_id string (required) client_id of Oauth Application from marketing console.
client_secret string (required) client_secret of Oauth Application from marketing console.
• integration_id string (required) integration_id from external system
email string (required) Member email address
first_name string (required) Member first name
last_name string (required) Member last name
mobile_phone string (optional) mobile_phone of member from external system
referral_code string (optional) If submitted and valid, creates referral link to referral_code code owner and the new member created
sso_target_client_id string (optional) Request a specified Oauth Client ID as issuer of member access_token. Make sure OAuth Application has member scope. Default will be javascript Member OAuth Application if not submitted, or non-matching client_id
preferences.<name> string/array (optional) name should match published member preferences. Note: A member preference could be a string or an array of strings based on is_multi_select flag.

Create or Update a Visitor

This endpoint creates a visitor and allows reversing the visitor flag from true to false. It also accepts updating email, first_name and last_name.

Visitor token secret can be found or changed under <base_url>/console/program_settings.

Building 'visitor_token' parameter

Below is an example of building visitor_token in ruby. We will provide snippet code for generating the same via javascript.

Build visitor_token param

To create or update a visitor, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "client_id=<client_id>"
     -F "client_secret=<client_secret>"
     -F "visitor_token=<visitor_token>"
     -F "signature=<signature>"
     -F "timestamp=<timestamp>"
     -F "visitor=<true or false>"
     <base_url>/api/visitor/token

Returned JSON

{  
   "success":true,
   "data":{  
      "new_member":false,
      "member_id":"YYY-00000001",
      "access_token":"01ad03f1d4930cd65ddb744877d7926c6ab3b3959a0dfc5ca09922f714afc056",
      "refresh_token":"b609fcee1253e96d0ccb9d9d951371281b9b16301ffff19c26c32ee77e844256",
      "visitor":false,
      "integration_id":"785652416488367832"
   }
}

Note: The returned access_token here is for Member APIs.

Form Parameters using client_id and client_secret

Parameter Type Description
client_id string (required) client_id of Oauth Application from marketing console.
client_secret string (required) client_secret of Oauth Application from marketing console.
visitor_token string (required) integration_id from external system
timestamp string (required) Timestamp from client
signature string (required) Generated signature based on visitor_token, from Build visitor token
visitor boolean (optional) Either true or false; Default is true.

Possible Error Codes

Code Message
4508 Integration key not supported (from configured program setting attributes)
4705 Missing at least one required parameter (from configured program setting attributes)
4044 Member does not exist (if create_member=false param is submitted)
4062 Invalid member record (depends which attribute error'ed)
4024 Member account is deactivated (if updating existing member)
4704 Preference to assign is invalid (params like preferences.genre where genre is a published member preference)

Badges

All badges related operations is done under this path

<base_url>/program/api/badges

List All Badges

Returns paginated list of badges. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/badges

Returns paginated list of badges:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 7,
    "badges": [
      {
        "badge": {
          "id": 5,
          "name": "champ_badge",
          "label": "champ badge",
          "type": "StatusBadge",
          "description": "",
          "levels": 1,
          "status": "published",
          "start_period": null,
          "end_period": null,
          "expiration_interval": 1,
          "expiration_interval_period": "month",
          "payment_type": "any",
          "response_currency_amount": "0.00",
          "response_currency_name": "USD"
        }
      },
      {
        "badge": {
          "id": 4,
          "name": "latest_badge",
          "label": "latest badge",
          "type": "CollectorBadge",
          "description": "",
          "status": "published",
          "start_period": null,
          "end_period": null,
          "expiration_interval": 1,
          "expiration_interval_period": "month",
          "payment_type": "any",
          "response_currency_amount": "0.00",
          "response_currency_name": "USD"
        }
      },
      {
        "badge": {
          "id": 1,
          "name": "king_badges",
          "label": "King Badges",
          "type": "CollectorBadge",
          "description": "",
          "status": "published",
          "start_period": null,
          "end_period": null,
          "expiration_interval": 1,
          "expiration_interval_period": "month",
          "payment_type": "any",
          "response_currency_amount": "0.00",
          "response_currency_name": "USD"
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/badges

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
place id integer (optional) Place id of included location set in badges eligibility tab and use it as filter. Mutually exclusive to place name and place integration id
place name string (optional) Place name of included location set in badges eligibility tab and use it as filter. Mutually exclusive to place id and place integration id
place integration id string (optional) Place integration id of included location set in badges eligibility tab and use it as filter. Mutually exclusive to place id and place name
included locations boolean (optional) This enables location eligibility filter. Default: true

Events

All events related operations is done under this path

<base_url>/program/api/events

Show All Events

Returns paginated list of events. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/events

Returns paginated list of events:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 4,
    "events": [
      {
        "id": 1,
        "name": "eventu",
        "label": "Eventu",
        "start_at": "2019-07-03T00:00:00.000Z",
        "end_at": null,
        "timzone": "Etc/UTC",
        "metric_name": "point",
        "metric_amount": "0",
        "image": null,
        "location": null,
        "created_at": "2019-07-03T01:35:17.000Z",
        "updated_at": "2019-07-08T02:20:35.000Z"
      },
      {
        "id": 4,
        "name": "st_event",
        "label": "1st Event",
        "start_at": "2019-07-03T00:00:00.000Z",
        "end_at": null,
        "timzone": "Etc/UTC",
        "metric_name": "point",
        "metric_amount": "0",
        "image": null,
        "location": null,
        "created_at": "2019-07-03T01:38:23.000Z",
        "updated_at": "2020-08-12T10:30:03.000Z"
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/events

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
term string (required) Search term
place id integer (optional) Place id of included location set in events eligibility tab and use it as filter. Mutually exclusive to place name and place integration id
place name string (optional) Place name of included location set in events eligibility tab and use it as filter. Mutually exclusive to place id and place integration id
place integration id string (optional) Place integration id of included location set in events eligibility tab and use it as filter. Mutually exclusive to place id and place name
included locations boolean (optional) This enables location eligibility filter. Default: true

Rewards

All rewards related operations is done under this path

<base_url>/program/api/rewards

Endpoints like Delete and Update requires id parameter.

List All Rewards

Returns paginated list of rewards. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards

Returns paginated list of rewards:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 3,
    "rewards": [
      {
        "id": 1,
        "name": "jj_rewards",
        "description": "REWARDING!!!! Beer for you",
        "sku": "89123-128736",
        "metric_amount": "2.0",
        "allow_responses": "yes",
        "metric_name": "point",
        "label": "JJ REWARDS!!!!!!",
        "reward_type": "product",
        "status": "published",
        "published_at": "2015-07-21T11:41:28.000Z",
        "classes": [
          "coffee",
          "pizza"
        ]
      },
      {
        "id": 4,
        "name": "peter_headphone",
        "description": "Peter's Headphone to test Kat's Classes",
        "sku": "PETER-HEADPHONE",
        "metric_amount": "100.0",
        "allow_responses": "yes",
        "metric_name": "point",
        "label": "Peter Headphone",
        "reward_type": "product",
        "status": "draft",
        "classes": [
          "coffee",
          "pizza"
        ]
      },
      {
        "id": 5,
        "name": "mitch_test",
        "description": "",
        "sku": "",
        "metric_amount": null,
        "allow_responses": "yes",
        "metric_name": "point",
        "label": "mitch test",
        "reward_type": "product",
        "status": "published",
        "published_at": "2015-07-21T11:41:28.000Z"
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/rewards

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
sort string (optional) Sort options. Values: label updated_at created_at
Default: update_date desc
with_status string (optional) Filter status option. Values: 'draft', 'published' or 'archived'
Default: blank
place id integer (optional) Place id of included location set in rewards eligibility tab and use it as filter. Mutually exclusive to place name and place integration id
place name string (optional) Place name of included location set in rewards eligibility tab and use it as filter. Mutually exclusive to place id and place integration id
place integration id string (optional) Place integration id of included location set in rewards eligibility tab and use it as filter. Mutually exclusive to place id and place name
included locations boolean (optional) This enables location eligibility filter. Default: true

Search Rewards

Similar to list, but add parameter term. This works similar to /console/rewards search form

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards?term=Kat

Returns paginated list of rewards:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "rewards": [
      {
        "id": 1,
        "name": "kat_reward",
        "description": "REWARDING!!!! Beer for you",
        "sku": "89123-128736",
        "metric_amount": "2.0",
        "allow_responses": "yes",
        "metric_name": "point",
        "label": "JJ REWARDS!!!!!!",
        "reward_type": "product",
        "status": "published",
        "published_at": "2015-07-21T11:41:28.000Z"
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/rewards

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
term string (required) Search term
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50

Get Reward

Get reward either by id or name

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/rewards/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 198,
    "name": "feeling_challenge_part_2",
    "description": null,
    "sku": null,
    "metric_amount": "0.0",
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_interval": null,
    "response_interval_unit": null,
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "show_in_gallery": "yes",
    "show_in_rewards": "yes",
    "allow_responses": "yes",
    "effectivity_start": null,
    "effectivity_end": null,
    "status": "draft",
    "published_at": null,
    "created_at": "2016-06-27T07:50:59.000Z",
    "updated_at": "2016-06-27T07:50:59.000Z",
    "metric_name": "point",
    "label": "Feeling Challenge Part 2",
    "recurring": false,
    "recurring_schedule": {},
    "template_set_version_id": 0,
    "reward_type": "product",
    "show_to_public": false,
    "certificate_display_text": null,
    "news_feed_id": null,
    "share_on_news_feed": "manual",
    "prize_type": null,
    "prize_id": null,
    "prize_metric_amount": null,
    "prize_metric_name": null,
    "prize_frequency": null,
    "prize_probability": null,
    "properties": {
      "require_shipping_address": "yes"
    },
    "contest_draw_date": null,
    "certificate_external_site": null,
    "certificate_external_url": null
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

GET <base_url>/program/api/rewards/<id or name>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of reward to retrieve
access_token string (required) access_token from successful login

Create Reward

This endpoint requires reward hash of attributes.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "label=Hillard"
     -F "name=hillard"
     <base_url>/program/api/rewards

Returns all the attributes of created reward.

{
  "success": true,
  "data": {
    "id": 198,
    "name": "feeling_challenge_part_2",
    "description": null,
    "sku": null,
    "metric_amount": "0.0",
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_interval": null,
    "response_interval_unit": null,
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "show_in_gallery": "yes",
    "show_in_rewards": "yes",
    "allow_responses": "yes",
    "effectivity_start": null,
    "effectivity_end": null,
    "status": "draft",
    "published_at": null,
    "created_at": "2016-06-27T07:50:59.000Z",
    "updated_at": "2016-06-27T07:50:59.000Z",
    "metric_name": "point",
    "label": "Feeling Challenge Part 2",
    "recurring": false,
    "recurring_schedule": {},
    "template_set_version_id": 0,
    "reward_type": "product",
    "show_to_public": false,
    "certificate_display_text": null,
    "news_feed_id": null,
    "share_on_news_feed": "manual",
    "prize_type": null,
    "prize_id": null,
    "prize_metric_amount": null,
    "prize_metric_name": null,
    "prize_frequency": null,
    "prize_probability": null,
    "properties": {
      "require_shipping_address": "yes"
    },
    "contest_draw_date": null,
    "certificate_external_site": null,
    "certificate_external_url": null,
    "classes": [
      "coffee",
      "pizza"
    ]
  }
}

Failed response will return 406 code and something like:

{
   "code":4400,
   "name":"invalid_record",
   "message":"Name already taken."
}

HTTP Request

POST <base_url>/program/api/rewards

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
classes Array[Integer or String] IDs or internal_name of classes
rank rank (optional) rank attribute of reward to create

Update Reward

This endpoint requires reward hash of attributes and ID of reward being updated.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "name=delectus_aut_assumenda"
     <base_url>/program/api/rewards/<id>

Returns reward updated record

{
  "success": true,
  "data": {
    "id": 198,
    "name": "delectus_aut_assumenda",
    "description": null,
    "sku": null,
    "metric_amount": "0.0",
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_interval": null,
    "response_interval_unit": null,
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "show_in_gallery": "yes",
    "show_in_rewards": "yes",
    "allow_responses": "yes",
    "effectivity_start": null,
    "effectivity_end": null,
    "status": "draft",
    "published_at": null,
    "created_at": "2016-06-27T07:50:59.000Z",
    "updated_at": "2016-06-27T07:50:59.000Z",
    "metric_name": "point",
    "label": "Feeling Challenge Part 2",
    "recurring": false,
    "recurring_schedule": {},
    "template_set_version_id": 0,
    "reward_type": "product",
    "show_to_public": false,
    "certificate_display_text": null,
    "news_feed_id": null,
    "share_on_news_feed": "manual",
    "prize_type": null,
    "prize_id": null,
    "prize_metric_amount": null,
    "prize_metric_name": null,
    "prize_frequency": null,
    "prize_probability": null,
    "properties": {
      "require_shipping_address": "yes"
    },
    "contest_draw_date": null,
    "certificate_external_site": null,
    "certificate_external_url": null
  }
}

Failed response will return 406 code and something like:

{
   "code":4400,
   "name":"invalid_record",
   "message":"Name already taken."
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/rewards/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
reward hash (required) Hash attributes of reward to update
classes Array[Integer or String] IDs or internal_name of classes
rank rank (optional) rank attribute of reward to create

Delete Reward

Delete reward either by id or name

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/rewards/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 198,
    "name": "feeling_challenge_part_2",
    "description": null,
    "sku": null,
    "metric_amount": "0.0",
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_interval": null,
    "response_interval_unit": null,
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "show_in_gallery": "yes",
    "show_in_rewards": "yes",
    "allow_responses": "yes",
    "effectivity_start": null,
    "effectivity_end": null,
    "status": "draft",
    "published_at": null,
    "created_at": "2016-06-27T07:50:59.000Z",
    "updated_at": "2016-06-27T07:50:59.000Z",
    "metric_name": "point",
    "label": "Feeling Challenge Part 2",
    "recurring": false,
    "recurring_schedule": {},
    "template_set_version_id": 0,
    "reward_type": "product",
    "show_to_public": false,
    "certificate_display_text": null,
    "news_feed_id": null,
    "share_on_news_feed": "manual",
    "prize_type": null,
    "prize_id": null,
    "prize_metric_amount": null,
    "prize_metric_name": null,
    "prize_frequency": null,
    "prize_probability": null,
    "properties": {
      "require_shipping_address": "yes"
    },
    "contest_draw_date": null,
    "certificate_external_site": null,
    "certificate_external_url": null
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/rewards/<id or name>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of reward to delete
access_token string (required) access_token from successful login

Link a segment to a reward.

Example curl command to link included segment to reward.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "segment_id=1"
     -F "type=included"
     <base_url>/program/api/rewards/<id>/segments

Example curl command to link excluded segment to reward.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "segment_id=1"
     -F "type=excluded"
     <base_url>/program/api/rewards/<id>/segments

HTTP Request

POST <base_url>/program/api/rewards/<id>/segments

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of reward to update
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
segment_id integer (required) segment_id to link
type string (required) Segment link type, Values: included excluded

Unlink a segment to a reward.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/<id>/segments/<segment_id>

HTTP Request

DELETE <base_url>/program/api/rewards/<id>/segments/<segment_id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of reward to update
access_token string (required) access_token from successful login
segment_id integer (required) segment_id to unlink

Get Reward Redemptions

Returns paginated list of redemptions. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "member_id=<member id>"
     <base_url>/program/api/rewards/responses

Returns paginated list of redemptions:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "redemptions": [
      {
        "id": 3,
        "redemption_status": "pending",
        "member_name": "Arnulfo Lemke",
        "member_id": 4,
        "redemption_amount": "20",
        "metric_name": "point",
        "metric_display_name": "",
        "metric_amount": "20",
        "sku": null,
        "integration_id": "A-12345",
        "shipping_address": null,
        "image_url": "/images/standard/missing.png",
        "thumb_image_url": "/images/thumb/missing.png",
        "redemption_unit": "point",
        "notes": [],
        "created_at": "2016-05-28T03:31:18.000Z",
        "updated_at": "2016-05-28T03:31:18.000Z",
        "redemption": {
          "id": 4,
          "program_id": 1,
          "name": "circuit4",
          "description": "The HTTP system is down, connect the open-source pixel so we can transmit the FTP monitor!",
          "sku": "SKU-123",
          "metric_amount": "20.0",
          "response_max_per_member": null,
          "response_max_per_member_unit": null,
          "response_interval": null,
          "response_interval_unit": null,
          "response_max_overall": null,
          "response_max_overall_unit": null,
          "response_tier": null,
          "show_in_gallery": "yes",
          "show_in_redemptions": "yes",
          "allow_responses": "yes",
          "image_file_name": null,
          "image_content_type": null,
          "image_file_size": null,
          "image_updated_at": null,
          "effectivity_start": "2016-05-26T03:31:01.000Z",
          "effectivity_end": "2016-05-29T03:31:01.000Z",
          "status": "draft",
          "published_at": null,
          "created_at": "2016-05-28T03:31:18.000Z",
          "updated_at": "2016-05-28T03:31:18.000Z",
          "metric_name": "point",
          "label": "circuit4",
          "recurring": false,
          "recurring_schedule": {},
          "template_set_version_id": 0,
          "redemption_type": "product",
          "show_to_public": false,
          "certificate_display_text": null,
          "news_feed_id": null,
          "share_on_news_feed": "manual",
          "prize_type": null,
          "prize_id": null,
          "prize_metric_amount": null,
          "prize_metric_name": null,
          "prize_frequency": null,
          "prize_probability": null,
          "properties": {
            "require_shipping_address": "yes"
          },
          "contest_draw_date": null,
          "static_files": []
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/rewards/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
member_id string (optional) redemptions only for member with matching member id
integration_id string (optional) redemptions only for member with matching integration id
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
sort string (optional) Sort options. Values: created_at updated_at member_full_name sku redemption_status exported_at imported_at
Default: update_date desc

Search Redemptions

Returns paginated list of redemptions. Filter specific status by passing redemption_status param or use term to pass a search spec. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "redemption_status=pending"
     <base_url>/program/api/rewards/responses

Returns paginated list of redemptions:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "redemptions": [
      {
        "id": 3,
        "redemption_status": "pending",
        "member_name": "Arnulfo Lemke",
        "member_id": 4,
        "redemption_amount": "20",
        "metric_name": "point",
        "metric_display_name": "",
        "metric_amount": "20",
        "sku": null,
        "integration_id": "A-12345",
        "shipping_address": null,
        "image_url": "/images/standard/missing.png",
        "thumb_image_url": "/images/thumb/missing.png",
        "redemption_unit": "point",
        "notes": [],
        "created_at": "2016-05-28T03:31:18.000Z",
        "updated_at": "2016-05-28T03:31:18.000Z",
        "redemption": {
          "id": 4,
          "program_id": 1,
          "name": "circuit4",
          "description": "The HTTP system is down, connect the open-source pixel so we can transmit the FTP monitor!",
          "sku": "SKU-123",
          "metric_amount": "20.0",
          "response_max_per_member": null,
          "response_max_per_member_unit": null,
          "response_interval": null,
          "response_interval_unit": null,
          "response_max_overall": null,
          "response_max_overall_unit": null,
          "response_tier": null,
          "show_in_gallery": "yes",
          "show_in_redemptions": "yes",
          "allow_responses": "yes",
          "image_file_name": null,
          "image_content_type": null,
          "image_file_size": null,
          "image_updated_at": null,
          "effectivity_start": "2016-05-26T03:31:01.000Z",
          "effectivity_end": "2016-05-29T03:31:01.000Z",
          "status": "draft",
          "published_at": null,
          "created_at": "2016-05-28T03:31:18.000Z",
          "updated_at": "2016-05-28T03:31:18.000Z",
          "metric_name": "point",
          "label": "circuit4",
          "recurring": false,
          "recurring_schedule": {},
          "template_set_version_id": 0,
          "redemption_type": "product",
          "show_to_public": false,
          "certificate_display_text": null,
          "news_feed_id": null,
          "share_on_news_feed": "manual",
          "prize_type": null,
          "prize_id": null,
          "prize_metric_amount": null,
          "prize_metric_name": null,
          "prize_frequency": null,
          "prize_probability": null,
          "properties": {
            "require_shipping_address": "yes"
          },
          "contest_draw_date": null,
          "static_files": []
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/rewards/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
member_id string (optional) redemptions only for member with matching member id
integration_id string (optional) redemptions only for member with matching integration id
term string (required) Search term
redemption_status string (optional) Values can be pending, processing, completed, cancelled or errored
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
sort string (optional) Sort options. Values: created_at updated_at member_full_name sku redemption_status exported_at imported_at
Default: update_date desc

Update Redemption

This endpoint requires attributes and ID of redemption being updated.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "redemption_status=cancelled"
     <base_url>/program/api/rewards/responses/<id>

Returns updated redemption record

{
  "success": true,
  "data": {
    "id": 4,
    "redemption_status": "cancelled",
    "member_name": "Arnulfo Lemke",
    "member_id": 6,
    "redemption_amount": "50",
    "metric_name": "point",
    "metric_display_name": "",
    "metric_amount": "50",
    "sku": null,
    "integration_id": "A-12345",
    "shipping_address": null,
    "image_url": "/images/standard/missing.png",
    "thumb_image_url": "/images/thumb/missing.png",
    "redemption_unit": "point",
    "notes": [],
    "created_at": "2016-05-28T03:31:19.000Z",
    "updated_at": "2016-05-28T03:31:19.000Z",
    "redemption": {
      "id": 6,
      "program_id": 3,
      "name": "hard_drive6",
      "description": "The HTTP system is down, connect the open-source pixel so we can transmit the FTP monitor!",
      "sku": "SKU-123",
      "metric_amount": "20.0",
      "response_max_per_member": null,
      "response_max_per_member_unit": null,
      "response_interval": null,
      "response_interval_unit": null,
      "response_max_overall": null,
      "response_max_overall_unit": null,
      "response_tier": null,
      "show_in_gallery": "yes",
      "show_in_redemptions": "yes",
      "allow_responses": "yes",
      "image_file_name": null,
      "image_content_type": null,
      "image_file_size": null,
      "image_updated_at": null,
      "effectivity_start": "2016-05-26T03:31:01.000Z",
      "effectivity_end": "2016-05-29T03:31:01.000Z",
      "status": "draft",
      "published_at": null,
      "created_at": "2016-05-28T03:31:19.000Z",
      "updated_at": "2016-05-28T03:31:19.000Z",
      "metric_name": "point",
      "label": "hard drive6",
      "recurring": false,
      "recurring_schedule": {},
      "template_set_version_id": 0,
      "redemption_type": "product",
      "show_to_public": false,
      "certificate_display_text": null,
      "news_feed_id": null,
      "share_on_news_feed": "manual",
      "prize_type": null,
      "prize_id": null,
      "prize_metric_amount": null,
      "prize_metric_name": null,
      "prize_frequency": null,
      "prize_probability": null,
      "properties": {
        "require_shipping_address": "yes"
      },
      "contest_draw_date": null,
      "static_files": []
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/rewards/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
redemption hash (optional) Hash attributes of redemption to update

Approve Redemption

Approving expects ID parameter.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/responses/<id>/approve

Returns simple JSON

{
  "success": true
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/rewards/responses/<id>/approve

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of redemption to reject
access_token string (required) access_token from successful login

Reject Redemption

Rejecting expects ID parameter.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "return_to_member=false"
     -F "reject_comment=fraud"
     <base_url>/program/api/rewards/responses/<id>/reject

Returns simple JSON

{
  "success": true
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/rewards/responses/<id>/reject

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of redemption to reject
access_token string (required) access_token from successful login
reject_comment string (required) reject_comment reason for rejecting
return_to_member boolean (optional) return_to_member flag

Delete Redemption

Deleting expects ID parameter.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/responses/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 4,
    "redemption_status": "pending",
    "member_name": "Arnulfo Lemke",
    "member_id": 6,
    "redemption_amount": "50",
    "metric_name": "point",
    "metric_display_name": "",
    "metric_amount": "50",
    "sku": null,
    "integration_id": "A-12345",
    "shipping_address": null,
    "image_url": "/images/standard/missing.png",
    "thumb_image_url": "/images/thumb/missing.png",
    "redemption_unit": "point",
    "notes": [],
    "created_at": "2016-05-28T03:31:19.000Z",
    "updated_at": "2016-05-28T03:31:19.000Z",
    "redemption": {
      "id": 6,
      "program_id": 3,
      "name": "hard_drive6",
      "description": "The HTTP system is down, connect the open-source pixel so we can transmit the FTP monitor!",
      "sku": "SKU-123",
      "metric_amount": "20.0",
      "response_max_per_member": null,
      "response_max_per_member_unit": null,
      "response_interval": null,
      "response_interval_unit": null,
      "response_max_overall": null,
      "response_max_overall_unit": null,
      "response_tier": null,
      "show_in_gallery": "yes",
      "show_in_redemptions": "yes",
      "allow_responses": "yes",
      "image_file_name": null,
      "image_content_type": null,
      "image_file_size": null,
      "image_updated_at": null,
      "effectivity_start": "2016-05-26T03:31:01.000Z",
      "effectivity_end": "2016-05-29T03:31:01.000Z",
      "status": "draft",
      "published_at": null,
      "created_at": "2016-05-28T03:31:19.000Z",
      "updated_at": "2016-05-28T03:31:19.000Z",
      "metric_name": "point",
      "label": "hard drive6",
      "recurring": false,
      "recurring_schedule": {},
      "template_set_version_id": 0,
      "redemption_type": "product",
      "show_to_public": false,
      "certificate_display_text": null,
      "news_feed_id": null,
      "share_on_news_feed": "manual",
      "prize_type": null,
      "prize_id": null,
      "prize_metric_amount": null,
      "prize_metric_name": null,
      "prize_frequency": null,
      "prize_probability": null,
      "properties": {
        "require_shipping_address": "yes"
      },
      "contest_draw_date": null,
      "static_files": []
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/rewards/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of redemption to delete
access_token string (required) access_token from successful login

Get Redemption

Get redemption details.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/rewards/responses/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 4,
    "redemption_status": "pending",
    "member_name": "Arnulfo Lemke",
    "member_id": 6,
    "redemption_amount": "50",
    "metric_name": "point",
    "metric_display_name": "",
    "metric_amount": "50",
    "sku": null,
    "integration_id": "A-12345",
    "shipping_address": null,
    "image_url": "/images/standard/missing.png",
    "thumb_image_url": "/images/thumb/missing.png",
    "redemption_unit": "point",
    "notes": [],
    "created_at": "2016-05-28T03:31:19.000Z",
    "updated_at": "2016-05-28T03:31:19.000Z",
    "redemption": {
      "id": 6,
      "program_id": 3,
      "name": "hard_drive6",
      "description": "The HTTP system is down, connect the open-source pixel so we can transmit the FTP monitor!",
      "sku": "SKU-123",
      "metric_amount": "20.0",
      "response_max_per_member": null,
      "response_max_per_member_unit": null,
      "response_interval": null,
      "response_interval_unit": null,
      "response_max_overall": null,
      "response_max_overall_unit": null,
      "response_tier": null,
      "show_in_gallery": "yes",
      "show_in_redemptions": "yes",
      "allow_responses": "yes",
      "image_file_name": null,
      "image_content_type": null,
      "image_file_size": null,
      "image_updated_at": null,
      "effectivity_start": "2016-05-26T03:31:01.000Z",
      "effectivity_end": "2016-05-29T03:31:01.000Z",
      "status": "draft",
      "published_at": null,
      "created_at": "2016-05-28T03:31:19.000Z",
      "updated_at": "2016-05-28T03:31:19.000Z",
      "metric_name": "point",
      "label": "hard drive6",
      "recurring": false,
      "recurring_schedule": {},
      "template_set_version_id": 0,
      "redemption_type": "product",
      "show_to_public": false,
      "certificate_display_text": null,
      "news_feed_id": null,
      "share_on_news_feed": "manual",
      "prize_type": null,
      "prize_id": null,
      "prize_metric_amount": null,
      "prize_metric_name": null,
      "prize_frequency": null,
      "prize_probability": null,
      "properties": {
        "require_shipping_address": "yes"
      },
      "contest_draw_date": null,
      "static_files": []
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

GET <base_url>/program/api/rewards/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of redemption to retrieve
access_token string (required) access_token from successful login

Get Reward Combinations

Get reward combinations

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/rewards/<id>/combinations

Returns simple JSON

{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "Literature",
      "size": "Petite",
      "sku": null,
      "amount": "12.00",
      "image": null
    },
    {
      "id": 2,
      "type": "Literature",
      "size": "Small",
      "sku": null,
      "amount": "12.00",
      "image": null
    },
    {
      "id": 3,
      "type": "Literature",
      "size": "Large",
      "sku": null,
      "amount": "12.00",
      "image": null
    }
  ]
}

HTTP Request

GET <base_url>/program/api/rewards/<id>/combinations

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of reward to retrieve

Add Reward Combination

Add attribute combination to reward

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/rewards/<id>/combinations

Returns simple JSON

{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "Literature",
      "size": "Petite",
      "sku": null,
      "amount": "12.00",
      "image": null
    },
    {
      "id": 2,
      "type": "Literature",
      "size": "Small",
      "sku": null,
      "amount": "12.00",
      "image": null
    },
    {
      "id": 3,
      "type": "Literature",
      "size": "Large",
      "sku": null,
      "amount": "12.00",
      "image": null
    }
  ]
}

Return JSON if attribute combination is invalid

{
  "code": 4100,
  "name": "not_allowed",
  "message": "Invalid class attribute."
}

HTTP Request

POST <base_url>/program/api/rewards/<id>/combinations

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of redemption to retrieve
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
combinations Array(integer) (required) Attribute combination IDs to add

Remove Reward Combination

Remove attribute combination from reward

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/rewards/<id>/combinations

Returns simple JSON

{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "Literature",
      "size": "Petite",
      "sku": null,
      "amount": "12.00",
      "image": null
    },
    {
      "id": 2,
      "type": "Literature",
      "size": "Small",
      "sku": null,
      "amount": "12.00",
      "image": null
    },
    {
      "id": 3,
      "type": "Literature",
      "size": "Large",
      "sku": null,
      "amount": "12.00",
      "image": null
    }
  ]
}

Return JSON if attribute combination is invalid

{
  "code": 4100,
  "name": "not_allowed",
  "message": "Invalid class attribute."
}

HTTP Request

DELETE <base_url>/program/api/rewards/<id>/combinations

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of redemption to retrieve
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
combinations Array(integer) (required) Attribute combination IDs to add

Get Reward Awards

Get awards of a reward. This list does not include awardable_type and awardable_id since it's the reward itself.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/rewards/<id>/awards?access_token=<access_token>

Return list of awards of reward

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "awards": [
      {
        "id": 5,
        "status": "pending",
        "code": "8eaaef42",
        "effectivity_start": null,
        "effectivity_end": null,
        "awarded_at": null,
        "claimed_at": null,
        "created_at": "2016-07-12T04:40:55.000Z",
        "updated_at": "2016-07-12T04:40:55.000Z",
        "admin_id": null,
        "reason": null,
        "member": {
          "id": 5,
          "email": "garnett.sanford5@donnellywilderman.name",
          "member_id": "S-000000001",
          "first_name": "Itzel",
          "last_name": "Smith",
          "integration_id": null
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/rewards/<id>/awards

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of reward to retrieve
access_token string (required) access_token from successful login

Get Reward Certificates

Get certificates of a reward.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/rewards/<id>/certificates?access_token=<access_token>

Return list of certificates of reward

{
  "success": true,
  "data": {
    "total_pages": [
      {
        "id": 20,
        "reward_id": 8,
        "member_id": null,
        "reward_response_id": 20,
        "award_id": null,
        "code": "7776559569497123",
        "effectivity_start": null,
        "effectivity_end": null,
        "created_at": null,
        "updated_at": "2016-05-24T06:17:59.000Z",
        "status": "redeemed",
        "secondary_codes": {
          "code1": "23458954"
        },
        "coupon_url": null
      },
      {
        "id": 21,
        "reward_id": 8,
        "member_id": 2,
        "reward_response_id": 20,
        "award_id": null,
        "code": "8886559569497456",
        "effectivity_start": null,
        "effectivity_end": null,
        "created_at": null,
        "updated_at": null,
        "status": "redeemed",
        "secondary_codes": {
          "code1": "56784390",
          "code2": "56224391"
        },
        "coupon_url": null
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/rewards/<id>/certificates

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of reward to retrieve
access_token string (required) access_token from successful login
with_status string (optional) Filter status option. Values: 'unused', 'reserved', 'awarded', 'redeemed'

Get Contest Prizes

Get list of available prizes for a reward contest.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/<id>/prizes

Return JSON:

{
  "success": true,
  "data": [
    {
      "id": 1,
      "reward_id": 34,
      "name": "fresh_red_apple",
      "label": "Fresh Red Apple",
      "description": "A fresh red apple just for you.",
      "image_file_name": null,
      "image_content_type": null,
      "image_file_size": null,
      "image_updated_at": null,
      "prize_type": "Prizeables::MetricPrize",
      "prize_id": null,
      "prize_metric_amount": "1.0",
      "prize_metric_name": "new_metric",
      "prize_frequency": null,
      "prize_probability": null,
      "number_of_winners": 10,
      "created_at": "2016-07-14T06:52:48.000Z",
      "updated_at": "2016-07-14T06:53:02.000Z"
    },
    {
      "id": 4,
      "reward_id": 34,
      "name": "rice_cooker",
      "label": "Rice Cooker",
      "description": "HD 8394 Rice Cooker",
      "image_file_name": null,
      "image_content_type": null,
      "image_file_size": null,
      "image_updated_at": null,
      "prize_type": "Prizeables::RewardAwardPrize",
      "prize_id": 42,
      "prize_metric_amount": null,
      "prize_metric_name": "",
      "prize_frequency": null,
      "prize_probability": null,
      "number_of_winners": 3,
      "created_at": "2016-08-01T09:22:26.000Z",
      "updated_at": "2016-08-01T09:22:46.000Z"
    }
  ]
}

HTTP Request

GET <base_url>/program/api/rewards/<id>/prizes

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of contest to retrieve available prizes from
access_token string (required) access_token from successful login

Awards

All awards related operations is done under this path

<base_url>/program/api/rewards/awards

List All Awards

Returns paginated list of awards. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/awards

Returns paginated list of awards:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "awards": [
      {
        "id": 9,
        "awardable_id": 8,
        "awardable_type": "Reward",
        "status": "pending",
        "code": "d572a909",
        "effectivity_start": null,
        "effectivity_end": null,
        "awarded_at": null,
        "claimed_at": null,
        "created_at": "2016-07-12T05:25:56.000Z",
        "updated_at": "2016-07-12T05:25:56.000Z",
        "admin_id": null,
        "reason": null,
        "member": {
          "id": 9,
          "email": "tod9@runolfsdottirglover.biz",
          "member_id": "P-000000001",
          "first_name": "Quinn",
          "last_name": "O'Conner",
          "integration_id": null
        }
      },
      {
        "id": 5,
        "awardable_id": 8,
        "awardable_type": "Reward",
        "status": "pending",
        "code": "8eaaef42",
        "effectivity_start": null,
        "effectivity_end": null,
        "awarded_at": null,
        "claimed_at": null,
        "created_at": "2016-07-12T04:40:55.000Z",
        "updated_at": "2016-07-12T04:40:55.000Z",
        "admin_id": null,
        "reason": null,
        "member": {
          "id": 5,
          "email": "garnett.sanford5@donnellywilderman.name",
          "member_id": "S-000000001",
          "first_name": "Itzel",
          "last_name": "Smith",
          "integration_id": null
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/rewards/awards

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
with_status string (optional) Filter status option. Values: 'pending', 'awarded', 'claimed', 'cancelled'
Default: blank

Get Award

Get an award.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/awards/<id>

Return JSON:

{
  "success": true,
  "data": {
    "id": 9,
    "awardable_id": 8,
    "awardable_type": "Reward",
    "status": "awarded",
    "code": "d572a909",
    "effectivity_start": null,
    "effectivity_end": null,
    "awarded_at": "2016-07-12T05:25:56.000Z",
    "claimed_at": null,
    "created_at": "2016-07-12T05:25:56.000Z",
    "updated_at": "2016-07-12T05:25:56.000Z",
    "admin_id": null,
    "reason": null,
    "member": {
      "id": 9,
      "email": "tod9@runolfsdottirglover.biz",
      "member_id": "P-000000001",
      "first_name": "Quinn",
      "last_name": "O'Conner",
      "integration_id": null
    }
  }
}

HTTP Request

GET <base_url>/program/api/rewards/awards/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of award to retrieve
access_token string (required) access_token from successful login

Grant Award

Grant award to a member. Requires reward_id and member_id. Reward should be a published reward. Depending on reward type, a member should have a valid mailing address.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/awards

Returns attributes of created award:

{
  "success": true,
  "data": {
    "id": 9,
    "awardable_id": 8,
    "awardable_type": "Reward",
    "status": "awarded",
    "code": "d572a909",
    "effectivity_start": null,
    "effectivity_end": null,
    "awarded_at": "2016-07-12T05:25:56.000Z",
    "claimed_at": null,
    "created_at": "2016-07-12T05:25:56.000Z",
    "updated_at": "2016-07-12T05:25:56.000Z",
    "admin_id": null,
    "reason": null,
    "member": {
      "id": 9,
      "email": "tod9@runolfsdottirglover.biz",
      "member_id": "P-000000001",
      "first_name": "Quinn",
      "last_name": "O'Conner",
      "integration_id": null
    }
  }
}

HTTP Request

POST <base_url>/program/api/rewards/awards

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
reward_id string (required) reward_id of reward to create the award
member_id string (required) member_id of member to create the award

Claim Award

Mark an award as claimed.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/awards/<id>/claim

Return JSON:

{
  "success": true
}

HTTP Request

PUT <base_url>/program/api/rewards/awards/<id>/claim

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of award to claim
access_token string (required) access_token from successful login

Cancel Award

Mark an award as cancelled.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/awards/<id>/cancel

Return JSON:

{
  "success": true
}

HTTP Request

DELETE <base_url>/program/api/rewards/awards/<id>/cancel

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of award to cancel
access_token string (required) access_token from successful login

Delete Award

Delete an award.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/awards/<id>

Return JSON:

{
  "success": true,
  "data": {
    "id": 9,
    "awardable_id": 8,
    "awardable_type": "Reward",
    "status": "awarded",
    "code": "d572a909",
    "effectivity_start": null,
    "effectivity_end": null,
    "awarded_at": "2016-07-12T05:25:56.000Z",
    "claimed_at": null,
    "created_at": "2016-07-12T05:25:56.000Z",
    "updated_at": "2016-07-12T05:25:56.000Z",
    "admin_id": null,
    "reason": null,
    "member": {
      "id": 9,
      "email": "tod9@runolfsdottirglover.biz",
      "member_id": "P-000000001",
      "first_name": "Quinn",
      "last_name": "O'Conner",
      "integration_id": null
    }
  }
}

HTTP Request

DELETE <base_url>/program/api/rewards/awards/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id of award to delete
access_token string (required) access_token from successful login

Certificates

All certificates related operations is done under this path

<base_url>/program/api/rewards/certificates

List All Certificates

Returns paginated list of certificates. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/rewards/certificates

Returns paginated list of certificates:

{
  "success": true,
  "data": {
    "total_pages": [
      {
        "id": 20,
        "reward_id": 8,
        "member_id": null,
        "reward_response_id": 20,
        "award_id": null,
        "code": "7776559569497123",
        "effectivity_start": null,
        "effectivity_end": null,
        "created_at": null,
        "updated_at": "2016-05-24T06:17:59.000Z",
        "status": "redeemed",
        "secondary_codes": {
          "code1": "23458954"
        },
        "coupon_url": null
      },
      {
        "id": 21,
        "reward_id": 8,
        "member_id": 2,
        "reward_response_id": 20,
        "award_id": null,
        "code": "8886559569497456",
        "effectivity_start": null,
        "effectivity_end": null,
        "created_at": null,
        "updated_at": null,
        "status": "redeemed",
        "secondary_codes": {
          "code1": "56784390",
          "code2": "56224391"
        },
        "coupon_url": null
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/rewards/certificates

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
sort string (optional) Sort options. Values: label updated_at created_at
Default: update_date desc
with_status string (optional) Filter status option. Values: 'unused', 'reserved', 'awarded', 'redeemed'

Challenges

All challenge related operations is done under this path

<base_url>/program/api/challenges

Some endpoints, such as Delete and Update, require an id parameter to identify the challenge. The id parameter can be the challenge's database id, the challenge's internal name.

List All Challenges

Returns paginated list of challenges. Optional page parameter to return offset records.

To get challenges via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "with_status=<with_status>"
     <base_url>/program/api/challenges

Returns paginated list of challenges:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "challenges": [
      {
        "id": 2,
        "response_type": "survey",
        "metric_name": "point",
        "metric_display_name": "Points",
        "metric_amount": "100",
        "start_period": null,
        "end_period": null,
        "heading": "What is the value of Pi?",
        "subheading": "",
        "body": "",
        "details": "",
        "image_url": "",
        "thumb_image_url": "",
        "response_setting": {
          "question_type": "numeric",
          "question": "What is the value of Pi?",
          "survey_options": [],
          "image_url": null,
          "maximum_number_of_characters": 0
        },
        "respondable": true,
        "favorited": false,
        "target_url": null,
        "internal_url": null
      },
      {
        "id": 1,
        "response_type": "photo",
        "metric": "point",
        "metric_name": "point",
        "metric_display_name": "Points",
        "metric_amount": "100",
        "award_amount": "100",
        "start_period": null,
        "end_period": null,
        "heading": "Weekend Warriors!",
        "subheading": "",
        "body": "This is the weekend warrior body<br>Another sweet line of text and<br>more than that...",
        "details": "- have to be over 21",
        "image_url": "",
        "thumb_image_url": "",
        "response_setting": {
          "resolution": "original"
        },
        "respondable": true,
        "favorited": false,
        "target_url": null,
        "internal_url": null
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/challenges

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
sort string (optional) Sort options. Values: label updated_at created_at
Default: update_date desc
with_status string (optional) Filter status option. Values: 'draft', 'published' or 'archived'
Default: blank
place id integer (optional) Place id of included location set in challenges eligibility tab and use it as filter. Mutually exclusive to place name and place integration id
place name string (optional) Place name of included location set in challenges eligibility tab and use it as filter. Mutually exclusive to place id and place integration id
place integration id string (optional) Place integration id of included location set in challenges eligibility tab and use it as filter. Mutually exclusive to place id and place name
included locations boolean (optional) This enables location eligibility filter. Default: true

Search Challenges

Search for a challenge that matches the provided term parameter. This API searches against Display Name, Internal Name or Tags name.

Note: This API performs the same search in the Cheetah Digital Marketing Console's Member screens (/console/challenges) Search form.

To search challenges via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges?term=value

Returns paginated list of challenges:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "challenges": [
      {
        "id": 2,
        "response_type": "survey",
        "metric_name": "point",
        "metric_display_name": "Points",
        "metric_amount": "100",
        "start_period": null,
        "end_period": null,
        "heading": "What is the value of Pi?",
        "subheading": "",
        "body": "",
        "details": "",
        "image_url": "",
        "thumb_image_url": "",
        "response_setting": {
          "question_type": "numeric",
          "question": "What is the value of Pi?",
          "survey_options": [],
          "image_url": null,
          "maximum_number_of_characters": 0
        },
        "respondable": true,
        "favorited": false,
        "target_url": null,
        "internal_url": null
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/challenges

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
term string (required) Search term
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
with_status string (optional) Filter status option. Values: 'draft', 'published' or 'archived'
Default: blank

Get Challenge

Get challenge either by id or name

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/challenges/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 521,
    "name": "the_number_one_challenge",
    "description": null,
    "eligibility": null,
    "effectivity_start": null,
    "effectivity_end": null,
    "visibility": null,
    "status": "draft",
    "goal": "feedback",
    "response_type": {
      "id": 519,
      "challenge_id": 521,
      "properties": {
        "resolution": "original",
        "share_on_gallery": "on_approval"
      },
      "created_at": "2016-06-24T07:25:39.756Z",
      "updated_at": "2016-06-24T07:25:39.756Z",
      "share_on_activity_feed": "on_manual_sharing"
    },
    "image_file_name": null,
    "image_content_type": null,
    "image_file_size": null,
    "image_updated_at": null,
    "show_in_gallery": null,
    "show_in_challenges": "yes",
    "allow_responses": "yes",
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_interval": null,
    "response_interval_unit": null,
    "created_at": "2016-06-24T07:25:39.746Z",
    "updated_at": "2016-06-24T07:25:39.759Z",
    "published_at": null,
    "metric_name": "point",
    "metric_amount": "0.0",
    "label": "The number one challenge",
    "auto_approve": null,
    "recurring": false,
    "recurring_schedule": {},
    "template_set_version_id": 0,
    "show_to_public": false,
    "news_feed_id": null,
    "share_on_news_feed": "manual",
    "prize_type": null,
    "prize_id": null,
    "prize_metric_amount": null,
    "prize_metric_name": null,
    "prize_frequency": null,
    "prize_probability": null,
    "show_as_alert": false
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

GET <base_url>/program/api/challenges/<id or name>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login

Create Challenge

Create a challenge

curl -X POSt
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "label=Post to Facebook"
     -F "name=post_challenge"
     <base_url>/program/api/challenges

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 521,
    "name": "the_number_one_challenge",
    "description": null,
    "eligibility": null,
    "effectivity_start": null,
    "effectivity_end": null,
    "visibility": null,
    "status": "draft",
    "goal": "feedback",
    "response_type": {
      "id": 519,
      "challenge_id": 521,
      "properties": {
        "resolution": "original",
        "share_on_gallery": "on_approval"
      },
      "created_at": "2016-06-24T07:25:39.756Z",
      "updated_at": "2016-06-24T07:25:39.756Z",
      "share_on_activity_feed": "on_manual_sharing"
    },
    "image_file_name": null,
    "image_content_type": null,
    "image_file_size": null,
    "image_updated_at": null,
    "show_in_gallery": null,
    "show_in_challenges": "yes",
    "allow_responses": "yes",
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_interval": null,
    "response_interval_unit": null,
    "created_at": "2016-06-24T07:25:39.746Z",
    "updated_at": "2016-06-24T07:25:39.759Z",
    "published_at": null,
    "metric_name": "point",
    "metric_amount": "0.0",
    "label": "The number one challenge",
    "auto_approve": null,
    "recurring": false,
    "recurring_schedule": {},
    "template_set_version_id": 0,
    "show_to_public": false,
    "news_feed_id": null,
    "share_on_news_feed": "manual",
    "prize_type": null,
    "prize_id": null,
    "prize_metric_amount": null,
    "prize_metric_name": null,
    "prize_frequency": null,
    "prize_probability": null,
    "show_as_alert": false
  }
}

HTTP Request

POST <base_url>/program/api/challenges

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Challenge Type List

Key Type
submit_photo Submit Photo
video Submit Video
meme Caption Photo
url View Url
photo View Photo
youtube View Youtube
share Share
post Post
connect Connect
like Like
follow Follow
rating Ratings Survey
multiple_choice Multiple Choice Survey
text Text Survey
numeric Numeric Survey
multi_question Multi-Question Survey
member_attribute Update Profile
member_preference Update Preference
join_group Join Group
check_in Check In
scratcher Scratcher
html_game HTML Game
augmented_reality Augmented Reality
generic Custom

Update Challenge

Update challenge either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "label=Post to Facebook Part 2"
     -F "name=post_challenge_two"
     <base_url>/program/api/challenges/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 521,
    "name": "the_number_one_challenge",
    "description": null,
    "eligibility": null,
    "effectivity_start": null,
    "effectivity_end": null,
    "visibility": null,
    "status": "draft",
    "goal": "feedback",
    "response_type": {
      "id": 519,
      "challenge_id": 521,
      "properties": {
        "resolution": "original",
        "share_on_gallery": "on_approval"
      },
      "created_at": "2016-06-24T07:25:39.756Z",
      "updated_at": "2016-06-24T07:25:39.756Z",
      "share_on_activity_feed": "on_manual_sharing"
    },
    "image_file_name": null,
    "image_content_type": null,
    "image_file_size": null,
    "image_updated_at": null,
    "show_in_gallery": null,
    "show_in_challenges": "yes",
    "allow_responses": "yes",
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_interval": null,
    "response_interval_unit": null,
    "created_at": "2016-06-24T07:25:39.746Z",
    "updated_at": "2016-06-24T07:25:39.759Z",
    "published_at": null,
    "metric_name": "point",
    "metric_amount": "0.0",
    "label": "The number one challenge",
    "auto_approve": null,
    "recurring": false,
    "recurring_schedule": {},
    "template_set_version_id": 0,
    "show_to_public": false,
    "news_feed_id": null,
    "share_on_news_feed": "manual",
    "prize_type": null,
    "prize_id": null,
    "prize_metric_amount": null,
    "prize_metric_name": null,
    "prize_frequency": null,
    "prize_probability": null,
    "show_as_alert": false
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login

Delete Challenge

Delete challenge either by id or name

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/challenges/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "id": 10,
    "name": "facebook_challenge",
    "description": "",
    "eligibility": null,
    "effectivity_start": null,
    "effectivity_end": null,
    "visibility": null,
    "status": "published",
    "goal": "feedback",
    "response_type": {
      "id": 10,
      "challenge_id": 10,
      "properties": {
        "suggested_text": "what's going on?dddd"
      },
      "created_at": "2015-06-09T23:41:44.000Z",
      "updated_at": "2015-06-25T06:52:29.000Z",
      "share_on_activity_feed": "on_manual_sharing"
    },
    "image_file_name": null,
    "image_content_type": null,
    "image_file_size": null,
    "image_updated_at": null,
    "show_in_gallery": "yes",
    "show_in_challenges": "yes",
    "allow_responses": "yes",
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_interval": null,
    "response_interval_unit": "day",
    "created_at": "2015-06-09T23:41:44.000Z",
    "updated_at": "2016-06-24T22:51:06.080Z",
    "published_at": "2015-06-09T23:44:04.000Z",
    "metric_name": "point",
    "metric_amount": "100.0",
    "label": "Facebook Challenge",
    "auto_approve": true,
    "recurring": false,
    "recurring_schedule": {},
    "template_set_version_id": 0,
    "show_to_public": true,
    "news_feed_id": null,
    "share_on_news_feed": "manual",
    "prize_type": null,
    "prize_id": null,
    "prize_metric_amount": null,
    "prize_metric_name": null,
    "prize_frequency": null,
    "prize_probability": null,
    "show_as_alert": false,
    "static_files": []
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/challenges/<id or name>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login

Update Challenge Definition

Update challenge definition either by id or name. Challenge has different types so here's how to update challenge definition based on each type:

Update Challenge Definition (Submit Photo)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[resolution]=high&definition[share_on_gallery]=on_approval&definition[news_feed_caption]={first_name} {last_name} submitted a photo"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "photo",
    "definition": {
      "resolution": "high",
      "share_on_gallery": "on_approval",
      "news_feed_caption": "{first_name} {last_name} submitted a photo"
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[resolution] string (required) Accepted resolution of submitted photo (i.e. original, high, medium, low)
definition[share_on_gallery] string (required) The event when a photo will be shared on gallery (i.e. on_submission, on_approval, on_manual_sharing)
definition[news_feed_caption] string (required) Custom caption of the photo when shared on news feed (e.g. {first_name} {last_name} submitted a photo)
asset file (optional) photo to upload

Update Challenge Definition (Submit Video)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[video_size_limit]=200&definition[share_on_gallery]=on_approval&definition[news_feed_caption]={first_name} {last_name} submitted a video"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "video",
    "definition": {
      "video_size_limit": "200",
      "share_on_gallery": "on_approval",
      "news_feed_caption": "{first_name} {last_name} submitted a video"
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[video_size_limit] string (required) Accepted file size of submitted video in MB (e.g. 50, 100, 200)
definition[share_on_gallery] string (required) The event when a video will be shared on gallery (i.e. on_submission, on_approval, on_manual_sharing)
definition[news_feed_caption] string (required) Custom caption of the video when shared on news feed (e.g. {first_name} {last_name} submitted a video)
asset file (optional) video to upload

Update Challenge Definition (Caption Photo)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[subtype]=caption_separate_from_image&definition[share_on_gallery]=on_approval&definition[news_feed_caption]={first_name} {last_name} created a caption"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "meme",
    "definition": {
      "subtype": "caption_separate_from_image",
      "image_url": "/system/challenge_assets/assets/000/000/007/standard/ratatowee.jpeg?1483672371",
      "share_on_gallery": "on_submission",
      "news_feed_caption": "{first_name} {last_name} created a caption"
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[subtype] string (required) The manner how the caption will be shown (i.e. caption_over_image, caption_separate_from_image)
definition[share_on_gallery] string (required) The event when a caption will be shared on gallery (i.e. on_submission, on_approval, on_manual_sharing)
definition[news_feed_caption] string (required) Custom caption of the caption when shared on news feed (e.g. {first_name} {last_name} created a caption)
asset file (optional) Image upload to be captioned

Update Challenge Definition (View URL)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[post_challenge_survey]=no&definition[url]=www.facebook.com&definition[caption]={first_name} {last_name}"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "view_content",
    "definition": {
      "subtype": "url",
      "url": "www.facebook.com",
      "caption": ""
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[post_challenge_survey] string (required) If there is a survey after completing the challenge (i.e. no, yes)
definition[url] string (required) The URL to be viewed (e.g. www.facebook.com)
definition[caption] string (required) Custom caption of the challenge when shared on news feed (e.g. {first_name} {last_name})

Update Challenge Definition (View Photo)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[post_challenge_survey]=no"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "view_content",
    "definition": {
      "subtype": "photo",
      "image_url": null,
      "caption": ""
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[post_challenge_survey] string (required) If there is a survey after completing the challenge (i.e. no, yes)
asset file (optional) Image upload to be viewed

Update Challenge Definition (View Youtube)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[post_challenge_survey]=no&definition[url]=https://www.youtube.com/watch?v=jNQXAC9IVRw&definition[caption]={first_name} {last_name}"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "view_content",
    "definition": {
      "subtype": "youtube",
      "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
      "caption": ""
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[post_challenge_survey] string (required) If there is a survey after completing the challenge (i.e. no, yes)
definition[url] string (required) The URL to be viewed (e.g. https://www.youtube.com/watch?v=jNQXAC9IVRw)
definition[caption] string (required) Custom caption of the challenge when shared on news feed (e.g. {first_name} {last_name})

Update Challenge Definition (Share URL Social Media)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[platforms][]=facebook&definition[url]=https://www.facebook.com/wdasdEWEasd231"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "social_media",
    "definition": {
      "subtype": "share",
      "platforms": [
        "twitter"
      ],
      "url": null,
      "twitter_post_body": "<small class='text-muted'>empty</small>",
      "suggested_image": null,
      "assets": null
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[platforms][] string (required) Social media site where the challenge is applicable (e.g. facebook, twitter)
definition[url] string (required) The URL of the post to be shared (e.g. https://www.facebook.com/wdasdEWEasd231)
definition[facebook_post_title] string (required) The title of facebook post to be shared (e.g. Summer!) if one of the platforms is facebook
definition[facebook_post_body] string (optional) The body of facebook post to be shared (e.g. Having fun here!) if one of the platforms is facebook
definition[facebook_url_display_name] string (optional) The display name for the post to be shared (e.g. Summer!) if one of the platforms is facebook
definition[twitter_post_body] string (optional) The body of twitter post to be shared (e.g. Having fun here!) if one of the platforms is twitter

Update Challenge Definition (Post Social Media)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[platforms][]=facebook&definition[hashtag]=#winterWonderland"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "social_media",
    "definition": {
      "subtype": "post",
      "platforms": [
        "facebook",
        "twitter"
      ],
      "content_type": "url",
      "hashtags": [
        "#winterWonderland"
      ],
      "texts": "",
      "suggested_image": null,
      "assets": null
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[platforms][] string (required) Social media site where the challenge is applicable (e.g. facebook, twitter)
definition[hashtag] string (required) The hashtag that should be included in the post (e.g. #winterWonderland)
definition[texts] string (optional) The string that should be included in the post (e.g. winter here!)

Update Challenge Definition (Connect Social Media)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[platforms][]=facebook"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "social_media",
    "definition": {
      "subtype": "connect",
      "platforms": [
        "facebook",
        "twitter"
      ]
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[platforms][] string (required) Social media site where the challenge is applicable (e.g. facebook, twitter)

Update Challenge Definition (Like Social Media)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[platforms][]=facebook&definition[url]=https://www.facebook.com/wdasdEWEasd231"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "social_media",
    "definition": {
      "subtype": "like",
      "platforms": [
        "twitter"
      ],
      "url": "https://www.facebook.com/wdasdEWEasd231"
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[platforms][] string (required) Social media site where the challenge is applicable (e.g. facebook, twitter)
definition[url] string (required) The URL of the post to be liked (e.g. https://www.facebook.com/wdasdEWEasd231)

Update Challenge Definition (Follow Social Media)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[platforms][]=facebook&definition[account]=@cheetahloyalty"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "social_media",
    "definition": {
      "subtype": "follow",
      "platforms": [
        "twitter"
      ],
      "account": "@cheetahloyalty"
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[platforms][] string (required) Social media site where the challenge is applicable (e.g. facebook, twitter)
definition[account] string (required) The account to be followed (e.g. @cheetahloyalty)

Update Challenge Definition (Rating Survey)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[question]=what is that?&definition[news_feed_caption]={first_name} {last_name} answered a question&definition[correct_response_qualifier]=equal&definition[allow_comments]=no&definition[correct_response]=3"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "survey",
    "definition": {
      "question_type": "rating",
      "question": "what is that?",
      "survey_options": [],
      "image_url": "/system/challenge_assets/assets/000/000/008/standard/ratatowee.jpeg?1483679119",
      "maximum_number_of_characters": 0,
      "allow_comments": true,
      "correct_response_qualifier": "all_answers_are_correct",
      "news_feed_caption": "{first_name} {last_name}",
      "correct_response": ""
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[question] string (required) The question for our rating survey (e.g. How is your experience?)
definition[news_feed_caption] string (required) Custom caption of the survey when shared on news feed (e.g. {first_name} {last_name})
definition[correct_response_qualifier] string (required) How the answer will be evaluated (e.g. equals, greater_than, less_than)
definition[allow_comments] string (required) If we allow comments (i.e. no, yes)
definition[correct_response] integer (required) Where the answer is compared if "correct_response_qualifier" value is not "all_answers_are_correct"
asset file (optional) Image upload for the survey

Update Challenge Definition (Multiple Choice Survey)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[question]=what is that?&definition[news_feed_caption]={first_name} {last_name} answered a question&definition[correct_response_qualifier]=equal&definition[correct_response]=3"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "survey",
    "definition": {
      "question_type": "rating",
      "question": "what is that?",
      "survey_options": [],
      "image_url": "/system/challenge_assets/assets/000/000/008/standard/ratatowee.jpeg?1483679119",
      "maximum_number_of_characters": 0,
      "allow_comments": true,
      "correct_response_qualifier": "all_answers_are_correct",
      "news_feed_caption": "{first_name} {last_name}",
      "correct_response": ""
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[question] string (required) The question for our rating survey (e.g. How is your experience?)
definition[news_feed_caption] string (required) Custom caption of the survey when shared on news feed (e.g. {first_name} {last_name})
definition[correct_response_qualifier] string (required) How the answer will be evaluated (i.e. all_answers_are_correct, is, is_any_of)
definition[correct_response] string (required) Where the answer is compared if "correct_response_qualifier" value is not "all_answers_are_correct"
asset file (optional) Image upload for the survey

Update Challenge Definition (Text Survey)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[question]=what is that?&definition[news_feed_caption]={first_name} {last_name} answered a question&definition[correct_response_qualifier]=equal&definition[correct_response]=3"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "survey",
    "definition": {
      "question_type": "rating",
      "question": "what is that?",
      "survey_options": [],
      "image_url": "/system/challenge_assets/assets/000/000/008/standard/ratatowee.jpeg?1483679119",
      "maximum_number_of_characters": 0,
      "allow_comments": true,
      "correct_response_qualifier": "all_answers_are_correct",
      "news_feed_caption": "{first_name} {last_name}",
      "correct_response": ""
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[question] string (required) The question for our rating survey (e.g. How is your experience?)
definition[news_feed_caption] string (required) Custom caption of the survey when shared on news feed (e.g. {first_name} {last_name})
definition[correct_response_qualifier] string (required) How the answer will be evaluated (i.e. all_answers_are_correct, is, is_any_of)
definition[correct_response] string (required) Where the answer is compared if "correct_response_qualifier" value is not "all_answers_are_correct"
definition[maximum_number_of_characters] integer (optional) The number of characters allowed for an answer (e.g. 100)
asset file (optional) Image upload for the survey

Update Challenge Definition (Numeric Survey)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[question]=what is that?&definition[news_feed_caption]={first_name} {last_name} answered a question&definition[correct_response_qualifier]=equal&definition[correct_response]=3"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "survey",
    "definition": {
      "question_type": "rating",
      "question": "what is that?",
      "survey_options": [],
      "image_url": "/system/challenge_assets/assets/000/000/008/standard/ratatowee.jpeg?1483679119",
      "maximum_number_of_characters": 0,
      "allow_comments": true,
      "correct_response_qualifier": "all_answers_are_correct",
      "news_feed_caption": "{first_name} {last_name}",
      "correct_response": ""
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[question] string (required) The question for our rating survey (e.g. How is your experience?)
definition[news_feed_caption] string (required) Custom caption of the survey when shared on news feed (e.g. {first_name} {last_name})
definition[correct_response_qualifier] string (required) How the answer will be evaluated (i.e. all_answers_are_correct, is, is_any_of)
definition[correct_response] integer (required) Where the answer is compared if "correct_response_qualifier" value is not "all_answers_are_correct" (e.g. 3)
definition[maximum_number_of_characters] string (optional) The number of characters allowed for an answer (e.g. 100)
asset file (optional) Image upload for the survey

Update Challenge Definition (Update Profile)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[traits][]=last_name"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "update_profile",
    "definition": {
      "subtype": "member_attribute",
      "attributes": {
        "required": [
          "last_name"
        ],
        "optional": [
          "first_name"
        ]
      }
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[traits][] string (required) The member attribute that needs to be updated (e.g. last_name, first_name)
definition[optional_traits][] string (optional) The member attribute that can be updated (e.g. last_name, first_name)

Update Challenge Definition (Update Preference)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[traits][]=brand"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "update_profile",
    "definition": {
      "subtype": "member_preference",
      "attributes": {
        "preferences": [
          "brand"
        ]
      }
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[traits][] string (required) The preference that needs to be included in the member's preference (e.g. interests, pets)

Update Challenge Definition (Join Group)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[max_number_of_group]=3&definition[group_class_id]=1"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "join_group",
    "definition": {
      "group_class_id": 1,
      "max_number_of_group": 0
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[group_class_id] integer (required) The id of the class where a group belongs (e.g. 2)
definition[max_number_of_group] integer (optional) The maximum number of group a member can join for this challenge (e.g. 3)

Update Challenge Definition (Check-In)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[locations_id][]=1"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "check_in",
    "definition": {
      "locations_id": [
        "1"
      ]
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[locations_id][] integer (required) The id of the locations (e.g. 1)

Update Challenge Definition (Scratcher Game)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[prize_calculation]=probability"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "game",
    "definition": {
      "subtype": "html_game",
      "html_game_id": 1,
      "prize_calculation": "random",
      "period_unit": "year"
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[prize_calculation] string (required) How the winner is determined (i.e. probability, every_nth, first_n, random)
definition[period_unit] string (required) The unit for the frequency of selection of the winner in the challenge if the "prize_calculation" is "first_n" (i.e. day, week, month, year) (ex. first 20 of each week)

Update Challenge Definition (HTML Game)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[prize_calculation]=probability&definition[definition]={}"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "game",
    "definition": {
      "subtype": "html_game",
      "html_game_id": 1,
      "prize_calculation": "random",
      "period_unit": "year",
      "generic_blob": "{}"
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[prize_calculation] string (required) How the winner is determined (i.e. probability, every_nth, first_n, random)
definition[period_unit] string (required) The unit for the frequency of selection of the winner in the challenge if the "prize_calculation" is "first_n" (i.e. day, week, month, year) (ex. first 20 of each week)
definition[definition] string (required) JSON definition for different options for the game (e.g. {name: 'Sample Game'})

Update Challenge Definition (Custom)

Update challenge definition either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "definition[generic_type]=probability&definition[definition]={}"
     <base_url>/program/api/challenges/<id>/definition

Returns simple JSON

{
  "success": true,
  "data": {
    "challenge_type": "generic",
    "definition": {
      "generic_type": "First to a location",
      "generic_blob": "{}"
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/<id or name>/definition

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of challenge to retrieve
access_token string (required) access_token from successful login
definition[generic_type] string (required) The type or name of the custom challenge (e.g. First to a location)
definition[definition] string (required) JSON definition for different options for the game (e.g. {name: 'Sample Game'})

Get Challenge Responses

Return a paginated list of challenge responses.

Use the optional page parameter to specify the page offset to start with.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/responses

Returns paginated list of challenge responses:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "responses": [
      {
        "id": 1,
        "response": "Lina",
        "attachment_url": "/challenge_responses/answer?1433310751",
        "status": "approved",
        "approval_status": "approved",
        "metric_name": "point",
        "metric_amount": "1.0",
        "comments": [],
        "created_at": "2015-06-03T05:52:32.000Z",
        "updated_at": "2015-06-03T05:52:32.000Z",
        "challenge": {
          "id": 2,
          "response_type": "photo",
          "metric": "point",
          "metric_name": "point",
          "metric_display_name": "Point",
          "metric_amount": "1",
          "award_amount": "1",
          "start_period": null,
          "end_period": null,
          "heading": "JJ Challenge",
          "subheading": null,
          "body": null,
          "details": null,
          "image_url": "",
          "thumb_image_url": "",
          "original_image_url": "",
          "action": null,
          "heading_color": null,
          "color": null,
          "bgcolor": null,
          "heading_bgcolor": null,
          "image1_bg": null,
          "layout_id": "master",
          "target_url": "",
          "internal_url": "challenge://2",
          "show_as_alert": false
        }
      },
      {
        "id": 2,
        "response": "Yeah",
        "attachment_url": "/challenge_responses/standard/answer?1433312828",
        "status": "approved",
        "approval_status": "approved",
        "metric_name": "point",
        "metric_amount": "2.0",
        "comments": [],
        "created_at": "2015-06-03T06:27:09.000Z",
        "updated_at": "2015-07-24T00:58:02.000Z",
        "challenge": {
          "id": 3,
          "response_type": "photo",
          "metric": "point",
          "metric_name": "point",
          "metric_display_name": "Points",
          "metric_amount": "2",
          "award_amount": "2",
          "start_period": null,
          "end_period": null,
          "heading": "JJ Challenge Not Auto Approve",
          "subheading": "",
          "body": "",
          "details": "",
          "image_url": "",
          "thumb_image_url": "",
          "original_image_url": "",
          "action": "",
          "heading_color": "",
          "color": null,
          "bgcolor": null,
          "heading_bgcolor": "",
          "image1_bg": null,
          "layout_id": "master",
          "target_url":"",
          "internal_url": "challenge://3",
          "show_as_alert": false
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/challenges/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50

Search Challenge Responses

Search for a challenge response that matches the provided term parameter. This API searches against Challenge label, Challenge name, Member full name or Member email.

Note: This API performs the same search in the Cheetah Digital Marketing Console's Challenge Responses screens (/console/challenges/responses) Search form.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/responses?term=nash

Returns paginated list of challenge responses:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "responses": [
      {
        "id": 1,
        "response": "Lina",
        "attachment_url": "/challenge_responses/answer?1433310751",
        "status": "approved",
        "approval_status": "approved",
        "metric_name": "point",
        "metric_amount": "1.0",
        "comments": [],
        "created_at": "2015-06-03T05:52:32.000Z",
        "updated_at": "2015-06-03T05:52:32.000Z",
        "challenge": {
          "id": 2,
          "response_type": "photo",
          "metric": "point",
          "metric_name": "point",
          "metric_display_name": "Point",
          "metric_amount": "1",
          "award_amount": "1",
          "start_period": null,
          "end_period": null,
          "heading": "Nashville Challenge",
          "subheading": null,
          "body": null,
          "details": null,
          "image_url": "",
          "thumb_image_url": "",
          "original_image_url": "",
          "action": null,
          "heading_color": null,
          "color": null,
          "bgcolor": null,
          "heading_bgcolor": null,
          "image1_bg": null,
          "layout_id": "master",
          "target_url": "",
          "internal_url": "challenge://2",
          "show_as_alert": false
        }
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/challenges/responses?term=nash

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
term string (required) Search term
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50

Get Challenge Response

Get details about a challenge response.

This API returns hash of challenge response.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/responses/<id>

Returned JSON

{
  "success": true,
  "data": {
    "id": 13,
    "response": "5.0",
    "attachment_url": "/images/standard/missing.png",
    "status": "rejected",
    "approval_status": "rejected",
    "metric_name": "point",
    "metric_amount": "100.0",
    "comments": [],
    "created_at": "2015-06-11T02:14:02.000Z",
    "updated_at": "2015-08-03T05:48:51.000Z",
    "challenge": {
      "id": 8,
      "response_type": "survey",
      "metric": "point",
      "metric_name": "point",
      "metric_display_name": "Points",
      "metric_amount": "100",
      "award_amount": "100",
      "start_period": null,
      "end_period": null,
      "heading": "Ronald Test",
      "subheading": null,
      "body": null,
      "details": null,
      "image_url": "",
      "thumb_image_url": "",
      "original_image_url": "",
      "action": null,
      "heading_color": null,
      "color": null,
      "bgcolor": null,
      "heading_bgcolor": null,
      "image1_bg": null,
      "layout_id": "master",
      "response_setting": {
        "question_type": "rating",
        "question": "Ok?",
        "survey_options": [],
        "image_url": null,
        "maximum_number_of_characters": 0,
        "allow_comments": false
      },
      "respondable": true,
      "favorited": false,
      "target_url": "",
      "internal_url": "challenge://8",
      "show_as_alert": false
    }
  }
}

HTTP Request

GET <base_url>/program/api/challenges/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of challenge response

Create Challenge Response

Create challenge response for member. Requires id of the challenge, answer hash parameter and member_id.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "member_id=<member_id>"
     -F "answer[text]=foo"
     -F "answer[attachment]=@path/to/file.jpg"
     <base_url>/program/api/challenges/<id>/responses

Returned JSON

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 4,
      "status": "submitted",
      "approval_status": "submitted"
    },
    "challenge_respondable": true
  }
}

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
id integer (required) id of challenge
member_id string (required) member_id of member
answer[text] string (required) text value of challenge response
answer[attachment] string (optional) optional attachment image or asset if required by the challenge

Update Challenge Response

Update a challenge response.

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "status=approved"
     <base_url>/program/api/challenges/responses/<id>

Returns JSON of deleted resource

{
  "success": true,
  "data": {
    "id": 13,
    "response": "5.0",
    "attachment_url": "/images/standard/missing.png",
    "status": "rejected",
    "approval_status": "approved",
    "metric_name": "point",
    "metric_amount": "100.0",
    "comments": [],
    "created_at": "2015-06-11T02:14:02.000Z",
    "updated_at": "2015-08-03T05:48:51.000Z",
    "challenge": {
      "id": 8,
      "response_type": "survey",
      "metric": "point",
      "metric_name": "point",
      "metric_display_name": "Points",
      "metric_amount": "100",
      "award_amount": "100",
      "start_period": null,
      "end_period": null,
      "heading": "Ronald Test",
      "subheading": null,
      "body": null,
      "details": null,
      "image_url": "",
      "thumb_image_url": "",
      "original_image_url": "",
      "action": null,
      "heading_color": null,
      "color": null,
      "bgcolor": null,
      "heading_bgcolor": null,
      "image1_bg": null,
      "layout_id": "master",
      "response_setting": {
        "question_type": "rating",
        "question": "Ok?",
        "survey_options": [],
        "image_url": null,
        "maximum_number_of_characters": 0,
        "allow_comments": false
      },
      "respondable": true,
      "favorited": false,
      "target_url": "",
      "internal_url": "challenge://8",
      "show_as_alert": false
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/challenges/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of challenge response

Delete Challenge Response

Delete a challenge response.

This API returns hash of deleted challenge response.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/responses/<id>

Returns JSON of deleted resource

{
  "success": true,
  "data": {
    "id": 13,
    "response": "5.0",
    "attachment_url": "/images/standard/missing.png",
    "status": "rejected",
    "approval_status": "rejected",
    "metric_name": "point",
    "metric_amount": "100.0",
    "comments": [],
    "created_at": "2015-06-11T02:14:02.000Z",
    "updated_at": "2015-08-03T05:48:51.000Z",
    "challenge": {
      "id": 8,
      "response_type": "survey",
      "metric": "point",
      "metric_name": "point",
      "metric_display_name": "Points",
      "metric_amount": "100",
      "award_amount": "100",
      "start_period": null,
      "end_period": null,
      "heading": "Ronald Test",
      "subheading": null,
      "body": null,
      "details": null,
      "image_url": "",
      "thumb_image_url": "",
      "original_image_url": "",
      "action": null,
      "heading_color": null,
      "color": null,
      "bgcolor": null,
      "heading_bgcolor": null,
      "image1_bg": null,
      "layout_id": "master",
      "response_setting": {
        "question_type": "rating",
        "question": "Ok?",
        "survey_options": [],
        "image_url": null,
        "maximum_number_of_characters": 0,
        "allow_comments": false
      },
      "respondable": true,
      "favorited": false,
      "target_url": "",
      "internal_url": "challenge://8",
      "show_as_alert": false
    }
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/challenges/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of challenge response

Respond

If a Challenge has a Secondary Prize (metric, award, or contest) the response will contain this information:

Data for both Award and Contest prizes will go under the reward attribute, distinguished only by their type.

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {
        "reward": {
            "id": 11,
            "type": "certificate",
            "sku": null,
            "draw_date": null,
            "points": "10000",
            "metric_amount": "10000",
            "metric": "point",
            "metric_name": "point",
            "metric_display_name": "Points",
            "start_date": null,
            "end_date": null,
            "heading": "CERT",
            "subheading": "",
            "body": "",
            "details": "",
            "image_url": "",
            "thumb_image_url": "",
            "original_image_url": "",
            "layout_id": "master",
            "awarded": false,
            "favorited": false,
            "redeemable": true,
            "respondable": true,
            "target_url": null,
            "internal_url": null,
            "address_required": false
      }
    }
  }
}

Data for Metric prize will go under the metric attribute, but unlike Award and Contest, it will have an accompanying attribute amount containing the metric amount value.

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {
        "amount": "99.0",
        "metric": {
          "id": 5,
          "name": "point",
          "label": "Point",
          "description": "",
          "type": "Point",
          "decimal_place": 0,
          "code": "Pw",
          "expirable": false
        }
    }
  }
}

If the Challenge does NOT have a Secondary Prize defined, the secondary_prize attribute will not be present.

Respond (Text-Only)

To respond to a Survey-Text-type challenge via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "answer[text]=<string text response>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Allows the user to respond to a text-only challenge.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[text] string (required) Text response to the challenge
answer[comment] string (optional) Comment (available for Rating Survey Type only)

Respond (List of Strings)

To respond to a Survey-Multiple Choice-type challenge via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "answer[text][]=<array list of strings>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Allows the user to respond to a list of strings challenge.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[text][] array (required) List of strings

Respond (Text and Image)

To respond to a Photo-type or Facebook-type challenge via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Allows the user to respond to a Photo-type or Facebook-type challenge.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[text] string (required) Caption of the photo
answer[attachment] string (required) Photo response to the challenge

Respond (Text and Video)

To respond to a Video-type challenge via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Allows the user to respond to a Video-type challenge.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[text] string (required) Caption of the photo
answer[attachment] string (required) Video response to the challenge

Respond (Update Profile)

To respond by updating profile via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Allows the user to respond to a challenge by updating profile.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[text] string (optional) Text response to the challenge

Respond (Photo Caption / Meme)

To respond to a Photo-Caption-type Challenge via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Allows the user to respond by sending a meme/photo caption.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[attachment] string (required) Photo response to the challenge
answer[text] string (optional) Text response to the challenge

Respond (View Content)

To respond (by viewing) to a content Challenge via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Allows the user to respond by viewing a content-- a URL, YouTube link or Photo.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[attachment] string (optional) Photo response to the challenge
answer[text] string (optional) Text response to the challenge

Respond (Join Group)

To respond by joining group via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Allows the user to respond to a challenge by joining group.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[text] string (optional) Text response to the challenge
answer[group_id][] array (required) Array of group IDs (May contain 1 or more IDs)

Respond (Custom)

To respond to a content Challenge via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/challenges/<id>/responses

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "challenge_response": {
      "id": 1,
      "status": "approved"
    },
    "challenge_respondable": true,
    "secondary_prize": {}
  }
}

Definition Example

{
  "action": {
    "url": "http://www.stellarloyalty.com/",
    "target": "comments"
  },
  "response": {
    "isbn": {
      "unique": true,
      "type": "string",
      "length": 3
    },
    "comments": {
      "type": "string"
    }
  }
}

Allows the user to respond by submitting a JSON string.

HTTP Request

POST <base_url>/program/api/challenges/<id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
id integer (required) id of a specific challenge

Form Parameters

Parameter Type Description
member_id string (required) member_id of member to create this response for
answer[text] string (optional) JSON response to the challenge

Offers

All offer related operations is done under this path

<base_url>/program/api/offers

Some endpoints, such as Delete and Update, require an id parameter to identify the offer. The id parameter can be the offers's database id or the offers's internal name.

List All Offers

Returns paginated list of offers. Optional page parameter to return offset records.

To get offers via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/offers

Returns paginated list of offers:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 4,
    "offers": [
      {
        "id": 14,
        "offer_type": "stellar",
        "label": "alarm13",
        "offer_type": "pos",
        "tags": [
          "id"
        ],
        "categories": [],
        "updated_at": "2016-08-27T23:37:23.000Z",
        "status": "draft",
        "recurring": false,
        "business_value": "0.0",
        "image": null
      },
      {
        "id": 15,
        "offer_type": "card14",
        "label": "card14",
        "offer_type": "pos",
        "tags": [
          "id"
        ],
        "categories": [],
        "updated_at": "2016-08-27T23:37:23.000Z",
        "status": "draft",
        "recurring": false,
        "business_value": "0.0",
        "image": null
      },
      {
        "id": 16,
        "offer_type": "stellar",
        "label": "capacitor15",
        "offer_type": "pos",
        "tags": [
          "id"
        ],
        "categories": [],
        "updated_at": "2016-08-27T23:37:23.000Z",
        "status": "draft",
        "recurring": false,
        "business_value": "0.0",
        "image": null
      },
      {
        "id": 17,
        "offer_type": "stellar",
        "label": "bandwidth16",
        "offer_type": "pos",
        "tags": [
          "id"
        ],
        "categories": [],
        "updated_at": "2016-08-27T23:37:23.000Z",
        "status": "draft",
        "recurring": false,
        "business_value": "0.0",
        "image": null
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/offers

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is based on Program Setting.
sort string (optional) Sort options. Values: label,update_date,publish_date, etc. Default: update_date desc
with_status string (optional) Status or comma-separated statuses (if multiple) in which offers will be filtered Values: published, draft, archived
term string (optional) Search term for offer label, category, tag in which offers will be filtered
campaign string (optional) Internal name of campaign in which offers will be filtered
place id integer (optional) Place id of included location set in offers eligibility tab and use it as filter. Mutually exclusive to place name and place integration id
place name string (optional) Place name of included location set in offers eligibility tab and use it as filter. Mutually exclusive to place id and place integration id
place integration id string (optional) Place integration id of included location set in offers eligibility tab and use it as filter. Mutually exclusive to place id and place name
included locations boolean (optional) This enables location eligibility filter. Default: true
ids array(integer) (optional) Array of DB IDs. Default: [].
names array(string) (optional) Array of internal names. Default: [].
status array(string) (optional) Array of publishing statuses. Values: draft published archived
Default: []

NOTE: campaign parameter will override any term values passed.

Get Offer

Get offer either by id or name

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/offers/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "name": "pixel1",
    "label": "pixel1",
    "description": "The SAS array is down, program the mobile driver so we can bypass the HDD circuit!",
    "offered_at": "2016-08-28T00:00:00.000Z",
    "expires_at": "2016-09-16T23:37:04.000Z",
    "value": 1,
    "created_at": "2016-08-27T23:37:20.000Z",
    "updated_at": "2016-08-27T23:37:20.000Z",
    "offer_type": "pos",
    "offer_action": null,
    "barcode": null,
    "offer_goal": null,
    "target_url": null,
    "effectivity_start": null,
    "effectivity_end": null,
    "effectivity_timezone": null,
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "response_interval": null,
    "response_interval_unit": null,
    "barcode_std": "code39",
    "show_in_offers": true,
    "allow_responses": true,
    "metric_name": null,
    "metric_amount": "0.0",
    "show_to_public": false,
    "share_on_news_feed": "manual",
    "recurring": false,
    "status": "draft",
    "business_value": "0.0",
    "categories": []
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

GET <base_url>/program/api/offers/<id or name>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of offer to retrieve
access_token string (required) access_token from successful login

Create Offer

Create new offer

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "label=Awesome Offer"
     -F "name=awesome_offer"
     <base_url>/program/api/offers

Returns simple JSON

{
  "success": true,
  "data": {
    "name": "pixel1",
    "label": "pixel1",
    "description": "The SAS array is down, program the mobile driver so we can bypass the HDD circuit!",
    "offered_at": "2016-08-28T00:00:00.000Z",
    "expires_at": "2016-09-16T23:37:04.000Z",
    "value": 1,
    "created_at": "2016-08-27T23:37:20.000Z",
    "updated_at": "2016-08-27T23:37:20.000Z",
    "offer_type": "pos",
    "offer_action": null,
    "barcode": null,
    "offer_goal": null,
    "target_url": null,
    "effectivity_start": null,
    "effectivity_end": null,
    "effectivity_timezone": null,
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "response_interval": null,
    "response_interval_unit": null,
    "barcode_std": "code39",
    "show_in_offers": true,
    "allow_responses": true,
    "metric_name": null,
    "metric_amount": "0.0",
    "show_to_public": false,
    "share_on_news_feed": "manual",
    "recurring": false,
    "status": "draft",
    "business_value": "0.0",
    "categories": []
  }
}

HTTP Request

POST <base_url>/program/api/offers

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Update Offer

Update offer expects either by id or name

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "label=Awesome Offer"
     -F "share_on_news_feed=true"
     <base_url>/program/api/offers/<id>

Returns simple JSON

{
  "success": true,
  "data": {
    "name": "pixel1",
    "label": "pixel1",
    "description": "The SAS array is down, program the mobile driver so we can bypass the HDD circuit!",
    "offered_at": "2016-08-28T00:00:00.000Z",
    "expires_at": "2016-09-16T23:37:04.000Z",
    "value": 1,
    "created_at": "2016-08-27T23:37:20.000Z",
    "updated_at": "2016-08-27T23:37:20.000Z",
    "offer_type": "pos",
    "offer_action": null,
    "barcode": null,
    "offer_goal": null,
    "target_url": null,
    "effectivity_start": null,
    "effectivity_end": null,
    "effectivity_timezone": null,
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "response_interval": null,
    "response_interval_unit": null,
    "barcode_std": "code39",
    "show_in_offers": true,
    "allow_responses": true,
    "metric_name": null,
    "metric_amount": "0.0",
    "show_to_public": false,
    "share_on_news_feed": "manual",
    "recurring": false,
    "status": "draft",
    "business_value": "0.0",
    "categories": []
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/offers/<id or name>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of offer to retrieve
access_token string (required) access_token from successful login

Delete Offer

Delete an existing offer.

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     <base_url>/program/api/offers/<id>

Returns JSON of deleted resource

{
  "success": true,
  "data": {
    "name": "pixel1",
    "label": "pixel1",
    "description": "The SAS array is down, program the mobile driver so we can bypass the HDD circuit!",
    "offered_at": "2016-08-28T00:00:00.000Z",
    "expires_at": "2016-09-16T23:37:04.000Z",
    "value": 1,
    "created_at": "2016-08-27T23:37:20.000Z",
    "updated_at": "2016-08-27T23:37:20.000Z",
    "offer_type": "pos",
    "offer_action": null,
    "barcode": null,
    "offer_goal": null,
    "target_url": null,
    "effectivity_start": null,
    "effectivity_end": null,
    "effectivity_timezone": null,
    "response_max_per_member": null,
    "response_max_per_member_unit": null,
    "response_max_overall": null,
    "response_max_overall_unit": null,
    "response_tier": null,
    "response_interval": null,
    "response_interval_unit": null,
    "barcode_std": "code39",
    "show_in_offers": true,
    "allow_responses": true,
    "metric_name": null,
    "metric_amount": "0.0",
    "show_to_public": false,
    "share_on_news_feed": "manual",
    "recurring": false,
    "status": "draft",
    "business_value": "0.0",
    "categories": []
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/offers/<id or name>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id string (required) id or name of offer to delete
access_token string (required) access_token from successful login

Get Offer Responses

Returns paginated list of offer responses. Optional page parameter to return offset records.

To get offer responses via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/offers/responses

Returns paginated list of offers responses:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "responses": [
      {
        "id": 1,
        "offer_id": 107,
        "member_id": 44,
        "approval_status": "approved",
        "metric_name": "point",
        "metric_amount": "0.0",
        "prize_type": null,
        "prize_metric_name": null,
        "prize_metric_amount": null,
        "prize_id": null,
        "created_at": "2016-03-15T12:44:24.000Z",
        "updated_at": "2016-03-15T12:44:24.000Z"
      },
      {
        "id": 2,
        "offer_id": 107,
        "member_id": 38277,
        "approval_status": "approved",
        "metric_name": "point",
        "metric_amount": "0.0",
        "prize_type": null,
        "prize_metric_name": null,
        "prize_metric_amount": null,
        "prize_id": null,
        "created_at": "2016-03-15T12:47:42.000Z",
        "updated_at": "2016-03-15T12:47:42.000Z"
      }
    ]
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

GET <base_url>/program/api/offers/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
term string (optional) URL encoded search term (id, offer_label, offer_name, member_full_name, member_email, member_nonunique_email certificate_codes, txn_id)
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
include_granting_object boolean (optional) include 'granting_object' details, default is false
result_with_categories boolean (optional) Values can be true or false. This parameter will return the category keys of the offer in an array.

Get Offer Response

Get existing offer response.

To get offer responses via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/offers/responses/<id>

Returned JSON:

{
  "success": true,
  "data": {
    "id": 1,
    "offer_id": 107,
    "member_id": 44,
    "approval_status": "approved",
    "metric_name": "point",
    "metric_amount": "0.0",
    "prize_type": null,
    "prize_metric_name": null,
    "prize_metric_amount": null,
    "prize_id": null,
    "created_at": "2016-03-15T12:44:24.000Z",
    "updated_at": "2016-03-15T12:44:24.000Z"
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

GET <base_url>/program/api/offers/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id integer (required) id of offer response
access_token string (required) access_token from successful login
include_granting_object boolean (optional) include 'granting_object' details, default is false
result_with_categories boolean (optional) Values can be true or false. This parameter will return the category keys of the offer in an array.
sort string (optional) Sort options, Values: label updated_at created_at
Default: updated_at desc

Create Offer Response

Create offer response for a member. This endpoint requires the ID of the member, and the offer_id of the offer. The offer should be properly configured and published.

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "member_id=<member_id>"
     <base_url>/program/api/offers/<offer_id>/responses

Returned JSON

{
  "success": true,
  "data": {
    "id": 3,
    "respondable": true,
    "certificate": {
      "code": "87654321",
      "start_date": null,
      "end_date": null
    }
  }
}

HTTP Request

POST <base_url>/program/api/offers/<offer_id>/responses

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
offer_id string (required) offer_id of reward to respond to in behalf of the member

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Form Parameters

Parameter Type Description
member_id string (required) member_id to create response in behalf of the member
effectivity_start string (optional) effectivity_start date of returned certificate
effectivity_end string (optional) effectivity_end date of returned certificate

Update Offer Response

Update an existing offer response.

To update an offer responses via command line, invoke the following cURL command:

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "approval_status=approved"
     <base_url>/program/api/offers/responses/<id>

Returned JSON:

{
  "success": true,
  "data": {
    "id": 1,
    "offer_id": 107,
    "member_id": 44,
    "approval_status": "approved",
    "metric_name": "point",
    "metric_amount": "0.0",
    "prize_type": null,
    "prize_metric_name": null,
    "prize_metric_amount": null,
    "prize_id": null,
    "created_at": "2016-03-15T12:44:24.000Z",
    "updated_at": "2016-03-15T12:44:24.000Z"
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/offers/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id integer (required) id of offer response to update
access_token string (required) access_token from successful login

Fulfill Offer Response

Fulfill an existing offer response as 'completed' process status.

To update an offer responses via command line, invoke the following cURL command:

curl -X PUT
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/offers/responses/<id or certificate_code>/fulfill

Returned JSON:

{
  "success": true
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

PUT <base_url>/program/api/offers/responses/<id or certificate_code>/fulfill

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id integer (optional) id of offer response to fulfill
certificate_code integer (optional) certificate_code of linked offer response to fulfill
redeem_on_fulfill boolean (optional) Set this to true to avoid errors during fulfilling of Offer Certificates (This is only applicable for Offers of type coupon)
Default: false
access_token string (required) access_token from successful login

Delete Offer Response

Returns paginated list of offer responses. Optional page parameter to return offset records.

To get offer responses via command line, invoke the following cURL command:

curl -X DELETE
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/offers/responses/<id>

Returned JSON:

{
  "success": true,
  "data": {
    "id": 1,
    "offer_id": 107,
    "member_id": 44,
    "approval_status": "approved",
    "metric_name": "point",
    "metric_amount": "0.0",
    "prize_type": null,
    "prize_metric_name": null,
    "prize_metric_amount": null,
    "prize_id": null,
    "created_at": "2016-03-15T12:44:24.000Z",
    "updated_at": "2016-03-15T12:44:24.000Z"
  }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

DELETE <base_url>/program/api/offers/responses/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
id integer (required) id of offer response to delete
access_token string (required) access_token from successful login

List All Offer Certificates

Returns paginated list of offer certificates. Optional page parameter to return offset records.

To get offer certificates via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/offers/certificates

Returns paginated list of offers certificates:

{
  "total_pages": 1,
  "total_entries": 2,
  "certificates": [
    {
        "id": 1,
        "offer_id": 8,
        "member_id": null,
        "code": "11223344",
        "status": "unused",
        "effectivity_start": null,
        "effectivity_end": null,
        "effectivity_timezone": null,
        "created_at": "2020-06-09T07:36:06.000Z",
        "updated_at": "2020-06-09T07:36:06.000Z",
        "offer_response_id": null,
        "merged_member_id": null,
        "member_identifier": null,
        "last_transition_at": null
    },
    {
        "id": 2,
        "offer_id": 8,
        "member_id": null,
        "code": "324516371",
        "status": "unused",
        "effectivity_start": null,
        "effectivity_end": null,
        "effectivity_timezone": null,
        "created_at": "2020-06-09T07:34:39.000Z",
        "updated_at": "2020-06-09T07:34:39.000Z",
        "offer_response_id": null,
        "merged_member_id": null,
        "member_identifier": null,
        "last_transition_at": null
    }
  ]
}

HTTP Request

GET <base_url>/program/api/offers/certificates

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
term string (optional) Search term
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50
sort string (optional) Sort options, Values: label updated_at created_at
Default: update_date desc
status string (optional) Filter by status, Values can be unused, reserved, awarded, redeemed, or fulfilled

Get Offer Certificate

Get offer certificate by certificate code.

To get an offer certificate via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/offers/certificates/<code>

Returned JSON when include_offer_response is not provided:

{
    "success": true,
    "data": {
        "id": 1,
        "offer_id": 6,
        "member_id": 1,
        "code": "1111",
        "status": "redeemed",
        "effectivity_start": null,
        "effectivity_end": null,
        "effectivity_timezone": null,
        "created_at": "2020-05-19T02:00:00.000Z",
        "updated_at": "2020-05-19T02:13:47.000Z",
        "offer_response_id": 3,
        "merged_member_id": null,
        "member_identifier": null,
        "last_transition_at": "2020-05-19T02:13:47.000Z"
    }
}

Returned JSON when include_offer_response is set to true:

{
    "success": true,
    "data": {
        "id": 1,
        "offer_id": 6,
        "member_id": 1,
        "code": "1111",
        "status": "redeemed",
        "effectivity_start": null,
        "effectivity_end": null,
        "effectivity_timezone": null,
        "created_at": "2020-05-19T02:00:00.000Z",
        "updated_at": "2020-05-19T02:13:47.000Z",
        "offer_response_id": 3,
        "merged_member_id": null,
        "member_identifier": null,
        "last_transition_at": "2020-05-19T02:13:47.000Z",
        "offer_response": {
            "id": 3,
            "offer_id": 6,
            "member_id": 1,
            "approval_status": "approved",
            "metric_name": "point",
            "metric_amount": "0.0",
            "prize_type": null,
            "prize_metric_name": null,
            "prize_metric_amount": null,
            "prize_id": null,
            "created_at": "2020-05-19T02:13:47.000Z",
            "updated_at": "2020-05-19T02:14:41.000Z",
            "business_value": "0.0",
            "certificate_codes": "1111",
            "activity_context": null,
            "processing_status": "completed",
            "message_id": null,
            "clipped_from_object": false,
            "message_action_id": null,
            "usage_start": null,
            "usage_end": null,
            "usage_timezone": "Etc/UTC",
            "usage_recurring": false,
            "usage_schedule": null,
            "coupon_type": null,
            "discount_type": null,
            "discount_value": "0.0",
            "discount_rate": "100.0",
            "granting_object_id": null,
            "granting_object_type": null,
            "clip_ext_id": null,
            "barcode": null,
            "txn_id": null,
            "integration_id": null,
            "response_instances": 1,
            "remaining_instances": 1,
            "last_transition_at": "2020-05-19T02:14:41.000Z",
            "original_granting_object_id": null,
            "original_granting_object_type": null,
            "merged_member_id": null,
            "short_claim_url": null,
            "overrides_json": {}
        }
    }
}

Return JSON if resource does not exist

{
  "code": 4044,
  "name": "not_available",
  "message": "Resource not available."
}

HTTP Request

GET <base_url>/program/api/offers/certificates/<code>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
code string (required) code of offer certificate
include_offer_response boolean (optional) If set to true, offer response details will be shown.
Default: false

Allocated Offers

To get offers via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base url>/api/allocated_offers

If successful, the response should look like this:

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 3,
    "offers": [
      {
        "id": 24,
        "internal_name": "display",
        "type": "certificate",
        "description": "null",
        "rank": "null",
        "campaign_id": 1,
        "campaign_rank": 1,
        "aggregated_business_value": "0.0",
        "start_date": "null",
        "end_date": "null",
        "response_start_date": "null",
        "response_end_date": "null",
        "response_schedule": "null",
        "trigger_activity_type": "null",
        "heading": "<h2>display</h2>",
        "subheading": "mobile details subheading ",
        "body": "mobile details body ",
        "subject": "",
        "details": "",
        "action": "",
        "heading_color": "",
        "color": "",
        "bgcolor": "",
        "heading_bgcolor": "",
        "image1_bg": "",
        "layout_id": "master",
        "image_url": "https://s3.amazonaws.com/stellar-qa-net9b1qlg8vk1v55llub/contents/images/000/000/648/standard/IMG_20150624_151219869.jpg?1435197227",
        "thumb_image_url": "https://s3.amazonaws.com/stellar-qa-net9b1qlg8vk1v55llub/contents/images/000/000/648/thumb/IMG_20150624_151219869.jpg?1435197227",
        "favorited": false,
        "respondable_info": {
          "value": true,
          "code": "",
          "meesage": ""
        },
        "target_url": "",
        "internal_url": "",
        "tracking_code": "null",
        "metric_amount": "5.0",
        "metric_name": "points",
        "acceptance_required": false,
        "acceptance_text": "",
        "acceptance_url": "null"
      },
      {
        "id": 23,
        "type": "url",
        "description": "null",
        "rank": "null",
        "campaign_id": 1,
        "campaign_rank": 3,
        "aggregated_business_value": "0.0",
        "url": "http://katkat.com",
        "start_date": "",
        "end_date": "",
        "response_start_date": "null",
        "response_end_date": "null",
        "response_schedule": "null",
        "trigger_activity_type": "null",
        "heading": "<span style=\"background-color: #31a354; color: #c7e9c0;\">display offers</span>",
        "subheading": "<span style=\"background-color: #756bb1;\">Master Subheading </span>",
        "body": "<span style=\"font-size: 20px; background-color: rgb(49, 130, 189); color: #fd8d3c;\">Master Body</span>",
        "details": "",
        "action": "",
        "heading_color": "",
        "color": "",
        "bgcolor": "",
        "heading_bgcolor": "",
        "image1_bg": "",
        "layout_id": "master",
        "image_url": "https://s3.amazonaws.com/stellar-qa-net9b1qlg8vk1v55llub/contents/images/000/000/604/standard/2mb.jpg?1435114101",
        "thumb_image_url": "https://s3.amazonaws.com/stellar-qa-net9b1qlg8vk1v55llub/contents/images/000/000/604/thumb/2mb.jpg?1435114101",
        "favorited": false,
        "respondable_info": {
          "value": true,
          "code": "",
          "meesage": ""
        },
        "target_url": "",
        "internal_url": "",
        "tracking_code": "null",
        "metric_amount": "5.0",
        "metric_name": "points",
        "acceptance_required": false,
        "acceptance_text": "",
        "acceptance_url": "null"
      },
      {
        "id": 22,
        "internal_name": "testing",
        "type": "null",
        "description": "null",
        "rank": "null",
        "campaign_id": 3,
        "campaign_rank": 1,
        "aggregated_business_value": "0.0",
        "start_date": "null",
        "end_date": "null",
        "response_start_date": "null",
        "response_end_date": "null",
        "response_schedule": "null",
        "trigger_activity_type": "null",
        "heading": "<h2>display offers21</h2>",
        "subheading": "mobile details  subheading ",
        "body": "mobile details body ",
        "subject": "",
        "details": "",
        "action": "",
        "heading_color": "",
        "color": "",
        "bgcolor": "",
        "heading_bgcolor": "",
        "image1_bg": "",
        "layout_id": "master",
        "image_url": "https://s3.amazonaws.com/stellar-qa-net9b1qlg8vk1v55llub/contents/images/000/000/648/standard/IMG_20150624_151219869.jpg?1435197227",
        "thumb_image_url": "https://s3.amazonaws.com/stellar-qa-net9b1qlg8vk1v55llub/contents/images/000/000/648/thumb/IMG_20150624_151219869.jpg?1435197227",
        "favorited": false,
        "respondable": true,
        "respondable_info": {
          "value": true,
          "code": "",
          "message": ""
        },
        "internal_url": "",
        "tracking_code": "null",
        "metric_amount": "5.0",
        "metric_name": "points",
        "acceptance_required": false,
        "acceptance_text": "",
        "acceptance_url": "null"
      }
    ]
  }
}

Lists allocated offers available to the user. Allocated Offers are offers from a Campaign that were computed and selected by the Machine Learning Engine based on a predefined model.

Allocated Offers Setup

  1. Create a Campaign and add/include Offers in the "Offers" tab
  2. Set up the Audience of the Campaign.
  3. Set the Campaign's target to a predefined ML Model in the "Targeting" tab
  4. Create and deploy a Member Attribute with an internal name that conforms to this format: ml_<campaign internal name>_ml_<ml model internal name>. This is where the allocated offers of a member will be stored.

    Note: Keep the Member Attribute's internal name short, i.e. less than 100 characters. You may override the generated value in the Edit Member Attribute form.

  5. Publish the Campaign

  6. Activate the Campaign as the source of Allocated Offers by providing its internal name in the Active ML Campaign Program Setting.

  7. Specify the number of Allocated Offers that will be listed in Allocated Offers Count Program Setting.

Stretch Offers

Stretch Offers is just a list of offers that will be attached to the list of Allocated Offers. There are no exact rules or steps to setting this up, since customers and promotions have different requirements. As long as the Offers are organized in a Campaign, and the Campaign is attached to a Placement, these offers will be listed in the API response when the proper stretch_placement is provided in the API parameters.

HTTP Request

GET <base url>/api/members/<member id>/allocated_offers

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

Query Parameters

Parameter Type Description
access_token string (required) access_token from successful login
Filter Param
respondable boolean (optional) If set to true, only offers that can be responded to will be shown. (Default: false)
show_clipped boolean (optional) If set to true, will show clipped and unclipped offers, false will show unclipped offers only (Default: false)
category string (optional) Comma-separated string of category internal names of Offers to include in the response
Extra Detail Param These parameters add extra details and has performance overhead. Please use sparingly.
stretch_placement string (optional) The internal name of the placement containing "stretch" offers. These offerse will be attached to the Allocated Offers list
stretch_placement_count integer (optional) How many stretch offers to fetch. If not provided, all available stretch offers will be listed.
include_clipped boolean (optional) If set to true, is_clipped attribute will be shown. (Default: false)
include_responses boolean (optional) If set to true, responses(Array) attribute that holds responses details will be shown. (Default: false)
result_with_categories boolean (optional) Values can be true or false. This parameter will return the category keys of the offer in an array.

Orders

To get orders via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "member_identifier=<member_identifier>"
     <base url>/program/api/orders

If successful, the response should look like this:

{
    "success": true,
    "data": {
        "total_pages": 1,
        "total_entries": 1,
        "orders": [
            {
                "id": 1,
                "transaction_type": "sale",
                "ordered_at": "2019-05-20T18:58:19.000Z",
                "preferred_receive_at": null,
                "source_name": "pos",
                "order_status": "completed",
                "integration_id": "124-7859202-20190522",
                "place_integration_id": "124",
                "terminal_name": "WEB",
                "transaction_id": "7859202",
                "business_date": "2019-05-22",
                "metric_name": "point",
                "metric_amount": "295.0",
                "currency": "USD",
                "eligible_subtotal": "0.00",
                "subtotal": "294.75",
                "overall_discount": "0.00",
                "tip_amount": "0.00",
                "service_charge": "0.00",
                "tax": "0.00",
                "total_amount": "294.75",
                "created_at": "2019-07-18T04:29:17.000Z",
                "updated_at": "2019-07-18T04:29:17.000Z",
                "overall_item_count": 6,
                "item_count": 2,
                "items": [
                    {
                        "id": 1,
                        "kind": "item",
                        "subkind": null,
                        "sku": "null-40",
                        "upc": null,
                        "category": [],
                        "name": "The Works&trade;",
                        "description": "The Works&trade;-14\" Large-FAMOUS THIN",
                        "line_number": "2",
                        "linked_line_number": "0",
                        "depth": 0,
                        "discountable": false,
                        "base_price": "54.30",
                        "weight": "0.0",
                        "quantity": "3.0",
                        "net_price": "162.90",
                        "discount": "0.00",
                        "amount": "162.90",
                        "created_at": null,
                        "updated_at": null
                    },
                    {
                        "id": 2,
                        "kind": "item",
                        "subkind": null,
                        "sku": "null-40",
                        "upc": null,
                        "category": [],
                        "name": "Pepperoni",
                        "description": "Pepperoni-14\" Large-FAMOUS THIN",
                        "line_number": "1",
                        "linked_line_number": "0",
                        "depth": 0,
                        "discountable": false,
                        "base_price": "43.95",
                        "weight": "0.0",
                        "quantity": "3.0",
                        "net_price": "131.85",
                        "discount": "0.00",
                        "amount": "131.85",
                        "created_at": null,
                        "updated_at": null
                    }
                ]
            }
        ]
    }
}

Lists all orders available to the user.

HTTP Request

GET <base url>/program/api/orders

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

Query Parameters

Parameter Type Description
access_token string (required) access_token from successful login
member_identifier string (required) member integration_id, member_id, email, card_id or mobile_phone
excluded_transaction_types Array (optional) List of transaction types to exclude. (sale, refund or void)
page numeric (optional) Offset page parameter
per_page numeric (optional) Number of items per page
sort_by string (optional) Sort options. Values can be id or ordered_at. default: ordered_at
sort_dir string (optional) Sort direction. Values can be desc or asc. default: desc

Order by ID

To get a specific order by ID via command line, invoke the following cURL command:

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "member_identifier=<member_identifier>"
     <base url>/program/api/orders/<id>

If successful, the response should look like this:

{
    "success": true,
    "data": {
        "id": 1,
        "transaction_type": "sale",
        "ordered_at": "2019-05-20T18:58:19.000Z",
        "preferred_receive_at": null,
        "source_name": "pos",
        "order_status": "completed",
        "integration_id": "124-7859202-20190522",
        "place_integration_id": "124",
        "place": {
            "id": null,
            "label": null,
            "name": null
        },
        "terminal_name": "WEB",
        "transaction_id": "7859202",
        "business_date": "2019-05-22",
        "metric_name": "point",
        "metric_amount": "295.0",
        "currency": "USD",
        "eligible_subtotal": "0.00",
        "subtotal": "294.75",
        "overall_discount": "0.00",
        "tip_amount": "0.00",
        "service_charge": "0.00",
        "tax": "0.00",
        "total_amount": "294.75",
        "created_at": "2019-07-18T04:29:17.000Z",
        "updated_at": "2019-07-18T04:29:17.000Z",
        "overall_item_count": 6,
        "item_count": 2,
        "items": [
            {
                "id": 1,
                "kind": "item",
                "subkind": null,
                "sku": "null-40",
                "upc": null,
                "category": [],
                "name": "The Works&trade;",
                "description": "The Works&trade;-14\" Large-FAMOUS THIN",
                "line_number": "2",
                "linked_line_number": "0",
                "depth": 0,
                "discountable": false,
                "base_price": "54.30",
                "weight": "0.0",
                "quantity": "3.0",
                "net_price": "162.90",
                "discount": "0.00",
                "amount": "162.90",
                "created_at": null,
                "updated_at": null
            },
            {
                "id": 2,
                "kind": "item",
                "subkind": null,
                "sku": "null-40",
                "upc": null,
                "category": [],
                "name": "Pepperoni",
                "description": "Pepperoni-14\" Large-FAMOUS THIN",
                "line_number": "1",
                "linked_line_number": "0",
                "depth": 0,
                "discountable": false,
                "base_price": "43.95",
                "weight": "0.0",
                "quantity": "3.0",
                "net_price": "131.85",
                "discount": "0.00",
                "amount": "131.85",
                "created_at": null,
                "updated_at": null
            }
        ]
    }
}

Allows the user to get a specific order.

HTTP Request

GET <base url>/program/api/orders/<id>

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

Query Parameters

Parameter Type Description
access_token string (required) access_token from successful login
member_identifier string (required) member integration_id, member_id, email, card_id or mobile_phone
id integer (required) id of a specific order

Create Order

To create an order via command line, invoke the following cURL command:

curl -X POST
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     -F "member_identifier=<member_identifier>"
     -d '{
        "business_date": "1988-01-17",
        "place_integration_id": 123,
        "subtotal": 23.00,
        "total_amount": 27.60,
        "transaction_id": 1,
        "transaction_ts": "1988-01-17T00:00:00.000Z",
        "transaction_type": "sale",
        "currency": "USD",
        "employee_full_name": "John Doe",
        "employee_identifier": "1223334444",
        "item_count": 2,
        "order_status": "completed",
        "overall_discount": 0.0,
        "overall_item_count": 5,
        "ext_integration_id": "231-2112-432",
        "preferred_receive_at": "2020-01-17T00:00:00.000Z",
        "service_charge": 2.3,
        "source": "pos",
        "tax": 2.3,
        "terminal_name": "A-1",
        "tip_amount": 0.0,
        "order_items": [
          {
            "amount": 18.00,
            "base_price": 5.00,
            "net_price": 20.00,
            "quantity": 4,
            "sku": "4444221333",
            "categories": ["food"],
            "depth": 0,
            "decription": "Cheese Pizza",
            "discount": 2.00,
            "ext_integration_id": "4444221333",
            "type": "item",
            "line_number": "1",
            "linked_line_number": "",
            "name": "cheese_pizza_1",
            "upc": "4444221333",
            "weight": 0.0
          },
          {
            "amount": 5.00,
            "base_price": 5.00,
            "net_price": 5.0,
            "quantity": 1,
            "sku": "889444444",
            "categories": ["food"],
            "depth": 0,
            "decription": "Hawaiian Pizza",
            "discount": 0.0,
            "ext_integration_id": "889444444",
            "type": "item",
            "line_number": "2",
            "linked_line_number": "",
            "name": "hawaiian_pizza_1",
            "upc": "889444444",
            "weight": 0.0
          }
        ]
      }'
     <base url>/program/api/orders

If successful, the response should look like this:

{
  "success": true
}

Create a member order.

HTTP Request

POST <base url>/program/api/orders

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

Query Parameters

Parameter Type Description
access_token string (required) access_token from successful login
member_identifier string (required) member integration_id, member_id, email, card_id or mobile_phone

Raw JSON

Parameter Type Description Values / Sample
business_date string (required) Order Business Date 1988-01-17
place_integration_id string (required) Store Identifier
subtotal bigdecimal (required) Order Subtotal Amount
total_amount bigdecimal (required) Order Total amount
transaction_id string (required) Transaction Id
transaction_ts string (required) Transaction Timestamp 1988-01-07T23:45:06.000Z
transaction_type string (required) Transaction Type sale, refund or void
currency string (optional) Order Currency USD
employee_full_name string (optional) Employee Fullname
employee_identifier string (optional) Employee Id
item_count integer (optional) Number of Unique Items
order_status string (optional) Order Status pending or completed
overall_discount bigdecimal (optional) Order Discount
overall_item_count integer (optional) Overall Item Count
ext_integration_id string (optional) Order External Id
preferred_receive_at string (optional) Preferred Receive At Timestamp 1988-01-07T23:45:06.000Z
service_charge bigdecimal (optional) Order Service Charge
source string (optional) Order Source pos, online, mobile, etc.
tax bigdecimal (optional) Order Tax
terminal_name string (optional) Terminal Name
tip_amount bigdecimal (optional) Order Tip Amount
order_items array[order items] (optional) Order Items

Order Items

Parameter Type Description Values / Sample
amount bigdecimal (required) Item Amount
base_price bigdecimal (required) Item Base Price
net_price bigdecimal (required) Item Net Price
quantity integer (required) Item Quantity
sku string (required) Item SKU
categories array[string] (optional) Item Categories
depth integer (optional) Item Depth/Level 0 - primary/parent, 1 - secondary/child
description string (optional) Item Description
discount bigdecimal (optional) Item Discount
ext_integration_id string (optional) Item External Id
type string (optional) Item Type item or coupon
line_number integer (optional) Item Line Number
linked_line_number integer (optional) Item Linked Line Number
name string (optional) Item Name
upc string (optional) Item UPC
weight decimal (optional) Item Weight

Evaluate Clawback

To evaluate a returned order via command line, invoke the following cURL command:

curl --location --request PUT '<base_url>/program/api/orders/<order_integration_id>/return?access_token=<access_token>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "status": "evaluate",
    "items": [
        {
            "level": 0,
            "line_number": 1,
            "parent_line_number": 0,
            "name": "Pepperoni",
            "description": "Pepperoni-14\" Large-FAMOUS THIN",
            "sku": 3061,
            "categories": [
                "3061"
            ],
            "quantity": 3,
            "unit_price": 43.95,
            "discountable": false
        }
    ]
}'

If member’s balance is greater than points_to_redeem, the response should look like this:

{
   "messages": {
       "display": [
           {
               "code": 200,
               "message": "Member - ITR-0000005040A has enough balance. No need to cancel rewards."
           }
       ]
   },
   "points_to_redeem": 20.50,
   "metric_name": "points",
   "member_id": "ITR-0000005040A",
   "member_balance": 30.00,
   "unused_rewards": []
}

If member’s balance is less than points_to_redeem, the response should look like this:

{
   "messages": {
       "display": [
           {
               "code": 201,
               "message": "Member - ITR-0000005040A does not have enough balance. Please cancel rewards, if any."
           }
       ]
   },
   "points_to_redeem": 20.50,
   "metric_name": "points",
   "member_id": "ITR-0000005040A",
   "member_balance": 10.00,
   "unused_rewards": [
       {
           "id": 12,
           "name": "offer_1",
           "metric_value": 2.5,
           "metric_name": "points",
           "expiration_date": "2021-10-01T14:53:00.000+08:00",
           "categories": []
       }
   ]
}

Evaluate order is used by the client to check the details of order that the customer wants to return.

HTTP Request

PUT <base_url>/program/api/orders/<order_integration_id>/return

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

Query Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Raw JSON

Parameter Type Description Values / Sample
status string (required) Status of clawback evaluate
items array[order items] Order items that the member wants to return

Order Items

Parameter Type Description Values / Sample
level integer (required) Item Depth/Level 0 - primary/parent, 1 - secondary/child
line_number integer (required) Item Line Number
parent_line_number integer (optional) Line Number of Parent Item
name string (optional) Item Name
description string (optional) Item Description
sku string (required) Item SKU
upc string (optional) Item UPC
entry_id string (optional) Item Entry ID
categories array[string] (optional) Item Categories
quantity integer (required) Item Quantity
unit_price bigdecimal (required) Item Unit Price
discountable boolean (optional) Item Discountable true/false
discount bigdecimal (optional) Item Discount

Process Clawback

To process a returned order via command line, invoke the following cURL command:

curl --location --request POST '<base_url>/program/api/orders/<order_integration_id>/return?access_token=<access_token>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "status": "process",
    "items": [
        {
            "level": 0,
            "line_number": 1,
            "parent_line_number": 0,
            "name": "Pepperoni",
            "description": "Pepperoni-14\" Large-FAMOUS THIN",
            "sku": 3061,
            "categories": [
                "3061"
            ],
            "quantity": 3,
            "unit_price": 43.95,
            "discountable": false
        }
    ],
    "offers": [
        {
            "id": 12,
            "name": "offer_1",
            "metric_value": 2.50,
            "metric_name": "points",
            "expiration_date": "2021-10-01T14:53:00.000+08:00",
            "categories": []
        }
    ]
}'

If successful, the response should look like this:

{
   "messages": {
       "display": [
           {
               "code": 208,
               "message": "Order - 124-78592021-20190522 created. Thank you!"
           }
       ]
   },
   "details": {
       "og_integration_id": "123-78592021-20190522",
       "member_id": "ITR-0000005040A"
   },
   "cancelled_rewards": [{
       "id": 12,
       "name": "offer_1",
       "metric_value": 2.50,
       "metric_name": "points",
       "expiration_date": "2021-10-01T14:53:00.000+08:00",
       "categories": []
   }],
   "deficit_points": 0.0
}

Process order is used if the client wants to finalize the return order request. At this part, selected offers by the client will be canceled and a new order will be created.

HTTP Request

POST <base_url>/program/api/orders/<order_integration_id>/return

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

Query Parameters

Parameter Type Description
access_token string (required) access_token from successful login

Raw JSON

Parameter Type Description Values / Sample
status string (required) Status of clawback process
items array[order items] Order items that the member wants to return
offers array[offer responses] Offer Responses that the member wants to cancel

Order Items

Parameter Type Description Values / Sample
level integer (required) Item Depth/Level 0 - primary/parent, 1 - secondary/child
line_number integer (required) Item Line Number
parent_line_number integer (optional) Line Number of Parent Item
name string (optional) Item Name
description string (optional) Item Description
sku string (required) Item SKU
upc string (optional) Item UPC
entry_id string (optional) Item Entry ID
categories array[string] (optional) Item Categories
quantity integer (required) Item Quantity
unit_price bigdecimal (required) Item Unit Price
discountable boolean (optional) Item Discountable true/false
discount bigdecimal (optional) Item Discount

Offer Responses

Parameter Type Description
id integer (required) Offer Response ID
name string (optional) Offer Name
metric_value bigdecimal (optional) Metric Value of Offer Response
metric_name string (optional) Metric Name of Metric Value
expiration_date string (optional) Expiration date of Offer Response
categories array[string] (optional) Offer Categories

Receipts

All receipts related operations is done under this path

<base_url>/program/api/receipts

List Receipts

Returns paginated list of receipts. Optional page parameter to return offset records.

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/receipts

Returned JSON

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 2,
    "receipts": [
      {
        "id": 110,
        "created_at": "2016-04-27T07:03:21.000Z",
        "updated_at": "2016-04-27T07:03:21.000Z",
        "created_by": "Jofell Jopes",
        "last_updated_by": "System",
        "receipt_url": "https://s3.amazonaws.com//DSC_0275.JPG?1461740600",
        "or_number": "1234",
        "or_date": "2016-04-27T15:03:00.000Z",
        "vendor": "walmart",
        "status": "submitted",
        "outcome": "none",
        "amount_paid": "100.0",
        "metric_amount": "0.0",
        "activity_submitted": false,
        "metric_name": "point",
        "uploaded_via": "email",
        "processing_type": "manual",
        "comment": null
      },
      {
        "id": 64,
        "created_at": "2016-02-11T10:47:11.000Z",
        "updated_at": "2016-02-11T10:48:28.000Z",
        "created_by": "System",
        "last_updated_by": "System",
        "receipt_url": "https://s3.amazonaws.com/amazon_receipt.png?1455187631",
        "or_number": null,
        "or_date": null,
        "vendor": null,
        "status": "completed",
        "outcome": "failed_unsupported_vendor",
        "amount_paid": "0.0",
        "metric_amount": "0.0",
        "activity_submitted": true,
        "metric_name": "point",
        "uploaded_via": "web",
        "processing_type": "manual",
        "comment": null
      }
    ]
  }
}

HTTP Request

GET <base_url>/program/api/receipts

Header Parameters

Parameter Type Value
Accept string (required) application/vnd.stellar-v1+json

URL Parameters

Parameter Type Description
access_token string (required) access_token from successful login
page integer (optional) page number offset, default is 1
per_page integer (optional) Number of items per_page, default is 50

Search Receipts

Similar to list, but add parameter term. This works similar to /console/receipts search form

curl -X GET
     -H 'Accept: application/vnd.stellar-v1+json'
     -F "access_token=<access_token>"
     <base_url>/program/api/receipts?term=Jofell

Returned JSON

{
  "success": true,
  "data": {
    "total_pages": 1,
    "total_entries": 1,
    "receipts": [
      {
        "id": 110,
        "created_at": "2016-04-27T07:03:21.000Z",
        "updated_at": "2016-04-27T07:03:21.000Z",
        "created_by": "Jofell Jopes",
        "last_updated_by": "System",
        "receipt_url": "https://s3.amazonaws.com//DSC_0275.JPG?1461740600",
        "or_number": "1234",
        "or_date": "2016-04-27T15:03:00.000Z",
        "vendor": "walmart",
        "status": "submitted",
        "outcome": "none",
        "amount_paid": "100.0",
        "metric_amount": "0.0",
        "activity_submitted": false,
        "metric_name": "point",
        "uploaded_via": "email",
        "processing_type": "manual",
        "comment": null
      }
    ]
  </