Skip to content

Create Thread

Resource URL

https://api.multividas.com/rest/v1/threads

Resource Information

MethodPOST
Response formatsJSON
Requires authentication?YES

Parameters

Param NameParam TypeDescriptionRequired
contentStringThe main content of the threadYes
filesObject, nullAttachments/files associated with the thread. If null, content is required.No
statusObjectValues indicating the status of the thread, including public visibility, comments, and anonymous status. StatusYes
schedule_atObjectValues specifying the schedule details for the thread, including the date and time (if applicable). ScheduleYes

Status Details

FieldTypeDescriptionRequired
isPublicStringIndicates if the thread is public or privateYes
isCommentsEnabledStringIndicates whether comments are enabled or notYes
isAnonymouslyStringIndicates if the thread is anonymous or notYes

Schedule Details

FieldTypeDescriptionRequired
selectedDateString, nullThe selected date for scheduling the threadNo
selectedTimeString, nullThe selected time for scheduling the threadNo

INFO

Anonoymous Threads are always unpinned !

Request Body (JSON)

json
{
  "content": "Hello World !",
  "files": null,
  "status": {
    "isPublic": "true",
    "isCommentsEnabled": "true",
    "isAnonymously": "false"
  },
  "schedule_at": {
    "selectedDate": null,
    "selectedTime": null
  }
}

INFO

The status and schedule_at fields are required in the request body. If files is null, the content field is required.

Response [422]

json
{
    "info": "The given data was invalid.",
    "code": 422,
    "meta": {
        "fields": {
            "content": [
                "The content field is required when files is empty."
            ]
        }
    }
}

Response [201 Created]

json
{
    "data": {
        "id": "01hered6ssgz8en3prvn5kx1jp",
        "content": "Hello World !",
        "isPublic": true,
        "isPinned": false,
        "isAnonymously": true,
        "isCommentsEnabled": false,
        "likesCount": 10,
        "commentsCount": 2,
        "rethreadsCount": 0,
        "files": null,
        "tags": [
            "multividas"
        ],
        "user": null,
        "createdAt": "2023-10-27T11:00:12.000000Z",
        "updatedAt": "2023-10-29T19:40:01.000000Z"
    },
    "code": 201,
    "meta": {}
}

Released under the MIT License.