Orishare
API reference
GET
/challenges

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Query Parameters

limit?integer
Range1 <= value <= 200
Default50
cursor?string
Lengthlength <= 2048
status?string

Value in

  • "draft"
  • "active"
  • "paused"
  • "ended"

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/challenges"
{  "data": [    {      "id": "string",      "name": "string",      "qualifying": {        "event": "string",        "conditions": null      },      "target": 0,      "period": "none",      "contribution_key": "string",      "enrollment": "automatic",      "repeatable": true,      "completion_actions": [        null      ],      "campaign_id": "string",      "starts_at": "2019-08-24T14:15:22Z",      "ends_at": "2019-08-24T14:15:22Z",      "status": "draft",      "version": 0,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/challenges

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/challenges" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "name": "Three purchases",    "qualifying": {      "event": "purchase"    },    "target": 3  }'
{  "id": "string",  "name": "string",  "qualifying": {    "event": "string",    "conditions": null  },  "target": 0,  "period": "none",  "contribution_key": "string",  "enrollment": "automatic",  "repeatable": true,  "completion_actions": [    null  ],  "campaign_id": "string",  "starts_at": "2019-08-24T14:15:22Z",  "ends_at": "2019-08-24T14:15:22Z",  "status": "draft",  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/challenges/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/challenges/string"
{  "id": "string",  "name": "string",  "qualifying": {    "event": "string",    "conditions": null  },  "target": 0,  "period": "none",  "contribution_key": "string",  "enrollment": "automatic",  "repeatable": true,  "completion_actions": [    null  ],  "campaign_id": "string",  "starts_at": "2019-08-24T14:15:22Z",  "ends_at": "2019-08-24T14:15:22Z",  "status": "draft",  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
PATCH
/challenges/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length
If-Match?string

Optional legacy revision. Missing or malformed values follow the existing route parser.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/challenges/string" \  -H "Content-Type: application/json" \  -d '{    "target": 4  }'
{  "id": "string",  "name": "string",  "qualifying": {    "event": "string",    "conditions": null  },  "target": 0,  "period": "none",  "contribution_key": "string",  "enrollment": "automatic",  "repeatable": true,  "completion_actions": [    null  ],  "campaign_id": "string",  "starts_at": "2019-08-24T14:15:22Z",  "ends_at": "2019-08-24T14:15:22Z",  "status": "draft",  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/challenges/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/challenges/string"
Empty
GET
/challenges/{id}/enrollments

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Query Parameters

limit?integer
Range1 <= value <= 200
Default50
cursor?string
Lengthlength <= 2048

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/challenges/string/enrollments"
{  "data": [    {      "challenge_id": "string",      "customer_id": "string",      "enrolled_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/challenges/{id}/enrollments

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key?string

Optional. When sent, the stored response is replayed for 24 h.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/challenges/string/enrollments" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_00000000000000000000000000000042"  }'
{  "challenge_id": "string",  "customer_id": "string",  "enrolled_at": "2019-08-24T14:15:22Z"}
DELETE
/challenges/{id}/enrollments/{customer_id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length
customer_id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/challenges/string/enrollments/string"
Empty
GET
/challenges/{id}/progress

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Query Parameters

limit?integer
Range1 <= value <= 200
Default50
cursor?string
Lengthlength <= 2048
customer_id?string

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/challenges/string/progress"
{  "data": [    {      "challenge_id": "string",      "customer_id": "string",      "period_key": "string",      "count": 0,      "target": 0,      "status": "active",      "contributions": [        "string"      ],      "completed_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/challenges/{id}/progress/revoke

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key?string

Optional. When sent, the stored response is replayed for 24 h.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/challenges/string/progress/revoke" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_00000000000000000000000000000042",    "contribution": "order_42"  }'
{  "challenge_id": "string",  "customer_id": "string",  "period_key": "string",  "count": 0,  "status": "active",  "contributions": [    "string"  ],  "completed_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/challenges/{id}/reevaluate

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/challenges/string/reevaluate" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_00000000000000000000000000000042"  }'
{  "completed": 0,  "conflicts": 0,  "effects": [    null  ]}