Value upload

Upload a binary blob for a given object; the API returns a valueRef you can store in subject state (valueRef) or pass to GET/DELETE /v1/value. filename and filemimetype in the query are optional; the HTTP body is the raw file content.

POST
{{host}}/v1/value?object={{object}}
VERB:POST
BASE URL:{{host}}/v1/value
QUERY STRING:?object={{object}}

Query parameters#

  • objectstring
    Required

    Unique name of the object in the URL.

    format:
    abc:0-9@owner
  • filenamestring
    Optional

    Optional. Original file name (e.g. for display and match patterns).

    example: photo.png
  • filemimetypestring
    Optional

    Optional. Declared MIME type for the uploaded bytes.

    example: image/png

Headers#

Send these headers with the request. Names are case-insensitive per HTTP rules.
  • x-api-keyRequired

    Your BigState API key.

    *provide api key here*

See authentication headers here.

Send the file as the HTTP body: raw bytes only, not a JSON
  • 200Response body · object

    Upload succeeded. Returns the new value reference to use in state `valueRef` and elsewhere.

    {
    "valueRef": "Mqn0WDHP8cuLYkMIjxAqmSdz8vRkTDDhB5Ie6Sn3"
    }
    • valueRefstring

      Opaque id for this blob (use in `GET`/`DELETE` /v1/value and in subject state).

  • 401

    Unauthorized.

  • 403

    Access denied. The caller does not have sufficient rights to perform this operation.

  • 400Response body · object

    Bad request.

    {
    "error": 6,
    "desc": "Invalid object name or upload parameters."
    }
    • errornumber

      Numeric error code. See the error codes reference for the full list.

    • descstring

      Human-readable description of the error.

Upload binary blob

POST raw file bytes (optional filename and filemimetype query params); response includes valueRef.

curl 'https://api.bigstate.dev/v1/value?object=Z5H1QxoGRz5vc6VeNIwwpVC6biVkYTqXe9SGQJJ6%3Aposition%3Avalueref%40Z5H1QxoGRz5vc6VeNIwwpVC6biVkYTqXe9SGQJJ6&filename=photo.png&filemimetype=image%2Fpng' \
--request POST \
--header 'x-api-key: YOUR_API_KEY' \
--data-binary ''

© 2024 BigState