Users

Users are the authors of cards and owners of collections. On this page, we’ll dive into the different verification routes you can use to manage Users programmatically. We'll look at how to create verifications.

The user model

The user model contains all the information about each user, including their email, username, website, and more.

Properties

  • Name
    id
    Type
    string
    Description

    The id of the user.

  • Name
    email
    Type
    string | null
    Description

    The email of the user. Can be null if a username is present and visible_email is false.

  • Name
    username
    Type
    string | null
    Description

    The username of the user.

  • Name
    website
    Type
    string | null
    Description

    The website of the user.

  • Name
    visible_email
    Type
    boolean
    Description

    Whether the email of the user is visible. Can only be false if a username is present.

PUT/api/user

Update a user

This route allows you to update yourself. (Must be authenticated to use)

Optional attributes

  • Name
    username
    Type
    string
    Description

    The username of the user.

  • Name
    website
    Type
    string
    Description

    The website of the user.

  • Name
    visible_email
    Type
    boolean
    Description

    Whether the email of the user is visible.

Response

If the response is successful it will return a 200 status code with the updated user.

  • Name
    user
    Type
    User
    Description

    A user object.

Request

POST
/api/user
  curl -L 'http://api.arguflow.ai/api/user' \
    -H 'Content-Type: application/json' \
    -H 'Cookie: ai-editor=your_cookie_value_here' \
    -d '{
        "username": "denssumesh",
    }'

Response

{
  "id": "0c6cc3dc-2069-4f5e-a306-eed3f13ac16e",
  "email": "foobar@gmail.com",
  "username": "denssumesh",
  "website": null,
  "visible_email": true
}

GET/user/:user_id/:page

Get the cards and votes for a user

This route allows you to get the cards and votes for a user, as well as other metadata about the user.

Response

If the response is successful it will return a 200 status code with an array of cards and metadata about the user.

  • Name
    id
    Type
    string
    Description

    The id of the user.

  • Name
    email
    Type
    string
    Description

    The email of the user.

  • Name
    username
    Type
    string | null
    Description

    The username of the user.

  • Name
    website
    Type
    string | null
    Description

    The website of the user.

  • Name
    visible_email
    Type
    boolean
    Description

    Whether the email of the user is visible.

  • Name
    created_at
    Type
    timestamp
    Description

    When the user was created.

  • Name
    total_cards_created
    Type
    integer
    Description

    The number of cards a user has created

  • Name
    cards
    Type
    [Card]
    Description

    An array of user-created cards.

Request

POST
/api/user
  curl --request GET \
    --url https://api.arguflow.ai/api/user/c9379ab0-389d-4204-8602-5ba1bf99d441/1 \
    --cookie ai-editor=your_cookie_value_here

Response

{
  "id": "c9379ab0-389d-4204-8602-5ba1bf99d441",
  "email": "dens.sumesh79@gmail.com",
  "username": "denssumesh",
  "website": null,
  "visible_email": true,
  "created_at": "2023-07-20T11:54:39.303730",
  "total_cards_created": 2396,
  "cards": [
    {
    "id": "9f6a2f8a-1dd6-4e40-8d03-4da8d79c09e7",
    "author": null,
    "content": "In more recent times, a concern about ‘new terrorism’, by which within the white imagination, ...",
    "card_html": "\n<p class=\"western\" style=\"line-height: 108%; margin-bottom: 0.11in\"><font face=\"Garamond..",
    "link": "https://ojs.library.queensu.ca/index.php/surveillance-and-society/article/view/stigma/4570",
    "qdrant_point_id": "ae7a2dcc-4069-492d-8380-6bd024c2b971",
    "total_upvotes": 0,
    "total_downvotes": 0,
    "vote_by_current_user": null,
    "created_at": "2023-07-20T19:50:49.874469",
    "updated_at": "2023-07-20T19:50:49.874490",
    "oc_file_path": "/Asian Masterfile - Wake 2018.docx",
    "private": false,
    "score": null,
    "file_id": "201d93c8-2927-42ce-8c6c-50a0a84136ba",
    "file_name": "Asian Masterfile - Wake 2018.docx",
    "verification_score": null
    },
    //...
  ]
}

GET/api/user/collections/:user_id

Get the collections for a user

This route allows you to get the collections for a user.

Response

If the response is successful it will return a 200 status code with an array of collections.

  • Name
    collections
    Type
    [Collection]
    Description

    An array of collection objects.

Request

POST
/api/user
  curl --request GET \
    --url http://localhost:8090/api/user/collections/c9379ab0-389d-4204-8602-5ba1bf99d441 \
    --cookie ai-editor=your_cookie_value_here

Response

[
  {
    "id": "8739b180-4bf1-4936-93f6-771d2d018c70",
    "author_id": "c9379ab0-389d-4204-8602-5ba1bf99d441",
    "name": "Collection for file Alien Futurity Negative - UTNIF 2018.docx",
    "is_public": true,
    "description": "",
    "created_at": "2023-07-20T11:55:21.445201",
    "updated_at": "2023-07-20T11:55:21.445294",
    "file_id": "2cdf94d5-9be3-4280-81c8-2c1cb7eb8f36"
  },
  //...
]

GET/api/user/files/:user_id

Get the files for a user

This route allows you to get the files for a user.

Response

If the response is successful it will return a 200 status code with an array of files.

  • Name
    files
    Type
    [File]
    Description

    An array of file objects.

Request

POST
/api/user
  curl --request GET \
    --url https://api.arguflow.ai/api/user/files/c9379ab0-389d-4204-8602-5ba1bf99d441 \
    --cookie ai-editor=your_cookie_value_here

Response

[
  {
  "id": "8faa158a-44af-4664-b46e-5752719139d6",
  "user_id": "c9379ab0-389d-4204-8602-5ba1bf99d441",
  "file_name": "AI Aff and Neg Updates - Northwestern 2018.docx",
  "mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "private": false,
  "created_at": "2023-07-20T11:55:09.021374",
  "updated_at": "2023-07-20T11:55:09.021444",
  "size": 176236,
  "oc_file_path": "/AI Aff and Neg Updates - Northwestern 2018.docx"
  },
  //..
]

GET/api/top_users/:page

Get the top users by score

This route allows you to get the top users by score (upvotes received - downvotes received).

Response

If the response is successful it will return a 200 status code with an array of users and the total number of pages.

  • Name
    users
    Type
    [User+score]
    Description

    An array of users with scores.

  • Name
    total_user_pages
    Type
    number
    Description

    The total number of pages.

Request

POST
/api/top_users/1
  curl --request GET \
    --url https://api.arguflow.ai/api/top_users/1 \
    --cookie ai-editor=your_cookie_value_here

Response

{
  "users": [
    {
      "id": "c9379ab0-389d-4204-8602-5ba1bf99d441",
      "email": "foobar@gmail.com",
      "username": "denssumesh",
      "website": null,
      "visible_email": false,
      "created_at": "2023-07-20T11:54:39.303730",
      "score": 0
    },
    //...
  ],
  "total_user_pages": 1
}