EndpointsCogents

Add cogent artifact

POST/v2/cogents/{cogent_id}/artifacts

Stores bytes by their SHA-256. Up to 262144 bytes may be sent inline and are stored at once; otherwise the response carries a presigned upload, and the artifact is readable after the bytes are PUT there and it is finished. Adding bytes already stored returns them unchanged. An image (for a chat line to carry) is sent inline with its mime; a visitor adds images too, with their user credential, readable by them and the cogent's own only.

Authorization

BearerAuth
AuthorizationBearer <token>

Bearer token issued by Softmax

In: header

Path Parameters

cogent_id*Cogent Id

Cogent ID (its player ID).

Match^ply_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

Request Body

application/json

sha256*Sha256

SHA-256 of the bytes, lowercase hex.

Match^[0-9a-f]{64}$
kind*Kind

What the bytes are: bas, replay, bot.

Match^[a-z0-9][a-z0-9._-]{0,31}$
size_bytes*Size Bytes

Length of the bytes.

Range0 <= value <= 5368709120
content_base64?|

The bytes, base64, for artifacts up to 262144 bytes. Omit it to get a presigned upload instead.

mime?|

For kind image (and only it): what the bytes are. An image is sent inline; the server reads its header and refuses a mismatch.

curl -X POST "https://softmax.com/api/observatory/v2/cogents/string/artifacts" \  -H "Content-Type: application/json" \  -d '{    "sha256": "string",    "kind": "string",    "size_bytes": 0  }'
{  "sha256": "string",  "kind": "string",  "size_bytes": 0,  "stored": true,  "upload": {    "url": "string",    "headers": {      "property1": "string",      "property2": "string"    },    "expires_at": "2019-08-24T14:15:22Z"  }}