API v1 POST contribution - SpaceFlow/Backend GitHub Wiki

POST /v1/contribution

Create a new contribution (or also known "tweet")

Required scope: post_for_user

Authorisation needed: yup

Parameters:

Type name description required
POST Body content Things you want to say. Max length: 200 Yes
POST Body mentioned_users Users you want to mention. Comma-seperated list of their IDs Nope

Potential Errors:

Error Code HTTP Status Code Description
APP_ID_NOT_FOUND 400 The API Server couldn't find the to the token associated application id
REQUIRED_SCOPE_NOT_SET 400 The token wasn't created with the scope required for this endpoint
TOKEN_NOT_FOUND 400 An invalid token was supplied in the authorisation header
AUTHORISATION_HEADER_NOT_PRESENT 400 should be self-explanatory
MISSING_CONTENT 400 The content header was either not found or empty
CONTENT_TOO_LONG 400 The content is longer than 200 characters

Example:

POST https://api.spaceflow.io/v1/contribution

POST Body (x-www-form-urlencoded): content=lets%20start%20shitposting&mentioned_users=1,2

Returns:

{
    "repost": false,
    "content": "nice memes guys",
    "mentioned_users": "simlply,the,list,you,supplied",
    "using_app": {
        "id": 420,
        "app_name": "Memeposter Client"
    },
    "by_user": user object of yourself,
    "timestamp": 12345234,
    "contribution_id": 1234,
    "error": null
}