Votes

A vote is how the community can provide feedback on the quality and relevance of a card. On this page, we will dive into the different vote routes you can use to manage votes programmatically.

The vote model

The attachment model contains all the information about a card, including the author, file, date created, and formatted card content.

Properties

  • Name
    id
    Type
    string
    Description

    The unique identifier for the vote.

  • Name
    voted_user_id
    Type
    string
    Description

    The user who created the vote.

  • Name
    card_metadata_id
    Type
    string
    Description

    The card that the vote is on.

  • Name
    vote
    Type
    boolean
    Description

    Whether the vote is an upvote or downvote.

  • Name
    created_at
    Type
    string
    Description

    The date and time the vote was created.

  • Name
    updated_at
    Type
    string
    Description

    The date and time the vote was last updated.

  • Name
    deleted
    Type
    boolean
    Description

    Whether the vote has been deleted.


POST/api/vote

Vote on a card

This route allows you to add an upvote or downvote to a card. (Must be authenticated to use)

Required attributes

  • Name
    card_metadata_id
    Type
    string
    Description

    The card you want to vote on.

  • Name
    vote
    Type
    string
    Description

    True to upvote, false to downvote.

Response

If the response is successful it will return a 200 status code with the created vote.

  • Name
    vote
    Type
    Vote
    Description

    A vote object.

Request

POST
/api/vote
  curl --location --request POST 'https://api.arguflow.ai/api/vote/' \
    --header 'Content-Type: application/json' \
    --header 'Cookie: ai-editor=your_cookie_value_here' \
    --data '{
        "card_metadata_id": "115672bd-02e9-4f7d-986f-f462c95dcdbc",
        "vote": true
    }'

Response

{
  "id": "e3cb3761-0812-4125-baa1-6527d84f39be",
  "voted_user_id": "f5e17d3d-0f77-49af-ad21-0d42f9b2ed5e",
  "card_metadata_id": "115672bd-02e9-4f7d-986f-f462c95dcdbc",
  "vote": true,
  "created_at": "2023-07-20T00:48:16.318202",
  "updated_at": "2023-07-20T00:48:16.318252",
  "deleted": false
}

DELETE/vote/:id

Delete a Vote on a card

This route allows you to delete the upvote or downvote on a card that you made. (Must be authenticated to use)

Response

If the response is successful it will return a 204 status code with no body.

Request

DELETE
/api/vote/115672bd-02e9-4f7d-986f-f462c95dcdbc
curl -X DELETE https://api.arguflow.ai/api/vote/115672bd-02e9-4f7d-986f-f462c95dcdbc \
  --header 'Cookie: ai-editor=your_cookie_value_here'