Orishare
API reference
POST
/quests/{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

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
If-Match*string

Required revision, checked in the owning transaction.

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/quests/string/enrollments" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example"  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "run_id": "string",  "run": "string",  "status": "enrolled",  "steps": [    {      "key": "string",      "progress": "string",      "status": "locked",      "activated_at": "2019-08-24T14:15:22Z"    }  ],  "completion_key": "string",  "claim_id": "string",  "pending": true}
POST
/quests/{id}/runs

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match*string

Required revision, checked in the owning transaction.

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/quests/string/runs" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example"  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "run_id": "string",  "run": "string",  "status": "enrolled",  "steps": [    {      "key": "string",      "progress": "string",      "status": "locked",      "activated_at": "2019-08-24T14:15:22Z"    }  ],  "completion_key": "string",  "claim_id": "string",  "pending": true}
POST
/quests/{id}/claims

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match*string

Required revision, checked in the owning transaction.

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/quests/string/claims" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example"  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "run_id": "string",  "run": "string",  "status": "enrolled",  "steps": [    {      "key": "string",      "progress": "string",      "status": "locked",      "activated_at": "2019-08-24T14:15:22Z"    }  ],  "completion_key": "string",  "claim_id": "string",  "pending": true}
POST
/quests/{id}/contributions

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match*string

Required revision, checked in the owning transaction.

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/quests/string/contributions" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example",    "event_id": "evt_example",    "step_key": "visit",    "value": 1  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "run_id": "string",  "run": "string",  "status": "enrolled",  "steps": [    {      "key": "string",      "progress": "string",      "status": "locked",      "activated_at": "2019-08-24T14:15:22Z"    }  ],  "completion_key": "string",  "claim_id": "string",  "pending": true}
POST
/quests/{id}/corrections

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match*string

Required revision, checked in the owning transaction.

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

curl -X POST "https://example.com/quests/string/corrections" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example",    "contribution_id": "pc_original",    "fraction": "1",    "reason": "Correct original contribution"  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "run_id": "string",  "run": "string",  "status": "enrolled",  "steps": [    {      "key": "string",      "progress": "string",      "status": "locked",      "activated_at": "2019-08-24T14:15:22Z"    }  ],  "completion_key": "string",  "claim_id": "string",  "pending": true}
GET
/quests

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Query Parameters

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

Value in

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

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

application/json

curl -X GET "https://example.com/quests"
{  "data": [    {      "id": "string",      "environment_id": "string",      "kind": "quest",      "key": "string",      "name": "string",      "status": "draft",      "active_version_id": "string",      "authority": "legacy",      "legacy_table": "string",      "version": -9007199254740991,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "archived_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "has_more": true}
GET
/quests/{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

application/json

curl -X GET "https://example.com/quests/string"
{  "id": "string",  "environment_id": "string",  "kind": "quest",  "key": "string",  "name": "string",  "status": "draft",  "active_version_id": "string",  "authority": "legacy",  "legacy_table": "string",  "version": -9007199254740991,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "archived_at": "2019-08-24T14:15:22Z"}
GET
/quests/{id}/participations

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Query Parameters

limit?integer
Range1 <= value <= 100
Default50
cursor?string
Lengthlength <= 2048
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

application/json

application/json

curl -X GET "https://example.com/quests/string/participations"
{  "data": [    {      "id": "string",      "program_id": "string",      "program_version_id": "string",      "customer_id": "string",      "status": "enrolled",      "state_revision": "string",      "state": {        "schema": "orishare.mechanic-state/v1",        "revision": "string",        "kind": "quest",        "run": "string",        "status": "enrolled",        "steps": [          {            "key": "string",            "progress": "string",            "status": "locked",            "activated_at": "2019-08-24T14:15:22Z"          }        ],        "selected_versions": [          {            "key": "string",            "version": 1,            "digest": "string"          }        ],        "claim_deadline": "2019-08-24T14:15:22Z",        "pending_completion": true      },      "effective_trust": "anonymous_claim",      "timezone": "string",      "timezone_source": "environment",      "tzdata_version": "string",      "enrolled_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "standing": "current"    }  ],  "next_cursor": "string",  "has_more": true}
GET
/quests/{id}/participations/{participation_id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length
participation_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

application/json

curl -X GET "https://example.com/quests/string/participations/string"
{  "id": "string",  "program_id": "string",  "program_version_id": "string",  "customer_id": "string",  "status": "enrolled",  "state_revision": "string",  "state": {    "schema": "orishare.mechanic-state/v1",    "revision": "string",    "kind": "quest",    "run": "string",    "status": "enrolled",    "steps": [      {        "key": "string",        "progress": "string",        "status": "locked",        "activated_at": "2019-08-24T14:15:22Z"      }    ],    "selected_versions": [      {        "key": "string",        "version": 1,        "digest": "string"      }    ],    "claim_deadline": "2019-08-24T14:15:22Z",    "pending_completion": true  },  "effective_trust": "anonymous_claim",  "timezone": "string",  "timezone_source": "environment",  "tzdata_version": "string",  "enrolled_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "standing": "current"}