Cards

Cards are the fundamental unit of information in Vault. They represent a single piece of information, such as an article, with an author, file, and formatted card content. On this page, we will dive into the different card routes you can use to manage and search through cards programmatically.

The card 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

    Unique identifier for the card.

  • Name
    author
    Type
    User
    Description

    User object containing the author's id and email.

  • Name
    content
    Type
    string
    Description

    Card content in plain text without html formatting.

  • Name
    card_html
    Type
    string
    Description

    Card content with HTML formatting.

  • Name
    link
    Type
    string
    Description

    The link to the article the card is from.

  • Name
    qdrant_point_id
    Type
    string
    Description

    The id of the card in Qdrant.

  • Name
    total_upvotes
    Type
    number
    Description

    The total number of upvotes the card has.

  • Name
    total_downvotes
    Type
    number
    Description

    The total number of downvotes the card has.

  • Name
    vote_by_current_user
    Type
    null | boolean
    Description

    The total number of downvotes the card has.

  • Name
    created_at
    Type
    timestamp
    Description

    The date and time the card was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    The date and time the card was last updated.

  • Name
    tag_set
    Type
    null | string
    Description

    Tags associated with the card.

  • Name
    file_id
    Type
    null | string
    Description

    The id of the file the card was uploaded from.

  • Name
    file_name
    Type
    null | string
    Description

    The name of the file the card was uploaded from.

  • Name
    private
    Type
    boolean
    Description

    Whether the card is visible to other users.

  • Name
    verification_score
    Type
    null | number
    Description

    The similarity score of the card to the webpage it is linked to.


POST/card

Create a Card

This route allows you to create a new card. (Must be authenticated to use)

Required attributes

  • Name
    card_html
    Type
    string
    Description

    The card content with html formatting. (Must be > 70 words)

  • Name
    link
    Type
    string
    Description

    The link to the article the card is from.

  • Name
    private
    Type
    boolean
    Description

    Whether the card is visible to other users.

Optional attributes

  • Name
    tag_set
    Type
    array
    Description

    The tags you wish to associate with the card.

  • Name
    file_uuid
    Type
    string
    Description

    The id of the file the card was uploaded from.

Response

If the response is successful it will return a 200 status code with the created card and whether it is a duplicate or not.

  • Name
    card_metadata
    Type
    Card
    Description

    The card object that was created.

  • Name
    duplicate
    Type
    boolean
    Description

    Whether the card is a duplicate of another card.

Request

POST
/api/card
curl --location 'https://api.arguflow.ai/api/card' \
    --header 'Content-Type: application/json' \
    --header 'Cookie: ai-editor=your_cookie_value_here' \
    --data '{
        "link": "https://google.com",
        "card_html": "\n<p class=\"western\" style=\"line-height: 108%; margin-bottom: 0.11in\"><u><b class=\"western\"><font size=\"3\"
                      style=\"font-size: 12pt\">Flight\ntesting</font></b></u><font size=\"2\" style=\"font-size: 11pt\"><u><span style=\"font-weight: normal\"><font size=\"3\"...",
        "private": true,
        "oc_file_path": "2017OpenEv/Radical Convivial Ed Aff - UTNIF 2017.html",
        "file_uuid": "c472d848-985a-4a0f-b166-4ab0e5c8f019"
      }'

Response

{
    "card_metadata": {
        "id": "19ddebb4-fc9f-4a8c-8a37-020b9b8b536d",
        "content": "Flight testing provides data for M&S and demonstrates the end-to-end performance functions of the operational system ...",
        "link": "https://google.com",
        "author_id": "f5e17d3d-0f77-49af-ad21-0d42f9b2ed5e",
        "qdrant_point_id": null,
        "created_at": "2023-07-20T00:00:59.743438016",
        "updated_at": "2023-07-20T00:00:59.743453706",
        "oc_file_path": "2017OpenEv/Radical Convivial Ed Aff - UTNIF 2017.html",
        "card_html": "\n<p class=\"western\" style=\"line-height: 108%; margin-bottom: 0.11in\"><u><b class=\"western\"><font size=\"3\" style=\"font-size: 12pt\">Flight\ntesting</font><...",
        "private": true
    },
    "duplicate": true
}

GET/api/card/:card_id

Get a Card

This route allows you to retrieve a card from the database using its id. (Must be authenticated and must be your card if private) Refer to the list at the top of this page to see which properties are included with card objects.

Response

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

  • Name
    card_metadata
    Type
    Card
    Description

    The card object that was created.

Request

GET
/api/card/19ddebb4-fc9f-4a8c-8a37-020b9b8b536d
    curl -G https://api.arguflwo.com/api/card/19ddebb4-fc9f-4a8c-8a37-020b9b8b536d \
        --header 'Cookie: ai-editor=your_cookie_value_here'

Response

{
    "id": "19ddebb4-fc9f-4a8c-8a37-020b9b8b536d",
    "author": {
        "id": "f5e17d3d-0f77-49af-ad21-0d42f9b2ed5e",
        "email": "dens.sumesh79@gmail.com",
        "username": null,
        "website": null,
        "visible_email": true,
        "created_at": "2023-06-02T19:55:45.932469"
    },
    "content": "Flight testing provides data for M&S and demonstrates the end-to-end performance functions of the operational system ...",
    "card_html": "\n<p class=\"western\" style=\"line-height: 108%; margin-bottom: 0.11in\"><u><b class=\"western\"><font size=\"3\" style=\"font-size: 12pt\">Flight\ntesting</font><...",
    "link": "https://google.com",
    "qdrant_point_id": "00000000-0000-0000-0000-000000000000",
    "total_upvotes": 0,
    "total_downvotes": 0,
    "vote_by_current_user": null,
    "created_at": "2023-07-20T00:00:59.743438",
    "updated_at": "2023-07-20T00:00:59.743453",
    "oc_file_path": "2017OpenEv/Radical Convivial Ed Aff - UTNIF 2017.html",
    "private": true,
    "score": null,
    "file_id": "c472d848-985a-4a0f-b166-4ab0e5c8f019",
    "file_name": "Emory-Giampetruzzi-Shaikh-Neg-Texas-Doubles (2).docx",
    "verification_score": 41
}

DELETE/api/card/:card_id

Delete a card

This route allows you to delete a card from the database using its id. (Must be authenticated and must be your card)

Response

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

Request

DELETE
/api/card/19ddebb4-fc9f-4a8c-8a37-020b9b8b536d
curl https://api.arguflow.ai/api/card/19ddebb4-fc9f-4a8c-8a37-020b9b8b536d \
   --header 'Cookie: ai-editor=your_cookie_value_here'

PUT/card/update

Update a card

This route allows you to update a card from the database using its id.

Required attributes

  • Name
    card_uuid
    Type
    string
    Description

    The card id of the card you wish to update.

Optional attributes

  • Name
    link
    Type
    string
    Description

    The new link for the card.

  • Name
    card_html
    Type
    string
    Description

    The new card_html for the card.

  • Name
    private
    Type
    boolean
    Description

    The new link for the attachment.

Response

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

Request

PUT
/v1/update
  curl --location --request PUT 'https://api.arguflow.ai/api/card/update' \
      --header 'Content-Type: application/json' \
      --header 'Cookie: ai-editor=your_cookie_value_here' \
      --data '{
          "card_uuid": "0b029764-6083-44ec-a741-7a278e7b1459",
          "private": false
      }'

POST/api/card/search/:page

Semantically search for a card

This route allows you to search the database by converting your query into a vector and searching for the most similar vectors in the database, returning the top 25 cards. You go through all the pages of cards by incrementing the page number in the request URL.

Required attributes

  • Name
    content
    Type
    string
    Description

    The query you wish to search for.

Optional attributes

  • Name
    tag_set
    Type
    array
    Description

    Tags to filter the search by.

  • Name
    link
    Type
    array
    Description

    Which links to include in the result.

Response

If the response is successful it will return a 200 status code with an 2D array of card objects and the collisions and the total pages of cards.

  • Name
    score_cards
    Type
    [Card]
    Description

    A 2D array of card objects and their collisions.

  • Name
    total_pages
    Type
    integer
    Description

    The total number of pages of cards.

Request

POST
/api/card/search/1
  curl --G 'https://api.arguflow.ai/api/card/search/1' \
    --header 'Content-Type: application/json' \
    --header 'Cookie: ai-editor=your_cookie_value_here' \
    --data '{
        "content": "test"
    }'

Response

{
  "score_cards": [
    {
      "metadata": [
        {
          "id": "115672bd-02e9-4f7d-986f-f462c95dcdbc",
          "author": {
            "id": "f5e17d3d-0f77-49af-ad21-0d42f9b2ed5e",
            "email": "dens.sumesh79@gmail.com",
            "username": null,
            "website": null,
            "visible_email": true,
            "created_at": "2023-06-02T19:55:45.932469"
          },
          "content": "Flight testing provides data for M&S and demonstrates the end-to-end performance functions of the operational system...",
          "card_html": "\n<p class=\"western\" style=\"line-height: 108%; margin-bottom: 0.11in\"><u><b class=\"western\"><font size=\"3\" style=\"font-size: 12pt\">Flight\ntesting</font></b></u><font size=\"2\" style=\"font-size: 11pt\"><u><span style=\"font-weight: normal\"><font size=\"3\" style=\"font-size: 12pt\">\n</font></span></u></font><font size=\"2\" style=\"font-size: 11pt\"><u><span style=\"font-weight: normal\">provides\n</span></u></font><u><b class=\"western\">data</b></u><font size=\"2\" style=\"font-size: 11pt\"><u>...",
          "link": "https://armedservices.house.gov/_cache/files/7/b/7bd5a9f3-9f36-4f32-8faa-1060352a25f6/7D4903AC8BC9BBE7FE075FD28F459508.hhrg-116-as29-wstate-greavess-20190508.pdf",
          "qdrant_point_id": "8e5a6e59-1975-48d0-91ac-a1e14c4d87ca",
          "total_upvotes": 0,
          "total_downvotes": 0,
          "vote_by_current_user": null,
          "created_at": "2023-07-13T04:36:56.545502",
          "updated_at": "2023-07-13T04:36:56.545504",
          "oc_file_path": null,
          "file_id": "c472d848-985a-4a0f-b166-4ab0e5c8f019",
          "file_name": "Emory-Giampetruzzi-Shaikh-Neg-Texas-Doubles (2).docx",
          "private": false,
          "verification_score": 17
        },
        //... other collisions
      ]
    },
    //... other cards
  ]
}

POST/api/card/fulltextsearch/:page

Search for a card using full-text

This route allows you to search the database using trigrams, returning the top 25 cards. You go through all the pages of cards by incrementing the page number in the request URL.

Required attributes

  • Name
    content
    Type
    string
    Description

    The query you wish to search for.

Optional attributes

  • Name
    tag_set
    Type
    array
    Description

    What tags to filters by.

  • Name
    link
    Type
    array
    Description

    Which links to include in the result.

Response

If the response is successful it will return a 200 status code with an 2D array of card objects and the collisions and the total pages of cards.

  • Name
    score_cards
    Type
    [Card]
    Description

    A 2D array of card objects and their collisions.

  • Name
    total_pages
    Type
    integer
    Description

    The total number of pages of cards.

Request

POST
/api/card/fulltextsearch/1
  curl --G 'https://api.arguflow.ai/api/card/fulltextsearch/1' \
    --header 'Content-Type: application/json' \
    --header 'Cookie: ai-editor=your_cookie_value_here' \
    --data '{
        "content": "test"
    }'

Response

{
  "score_cards": [
    {
      "metadata": [
        {
          "id": "115672bd-02e9-4f7d-986f-f462c95dcdbc",
          "author": {
            "id": "f5e17d3d-0f77-49af-ad21-0d42f9b2ed5e",
            "email": "dens.sumesh79@gmail.com",
            "username": null,
            "website": null,
            "visible_email": true,
            "created_at": "2023-06-02T19:55:45.932469"
          },
          "content": "Flight testing provides data for M&S and demonstrates the end-to-end performance functions of the operational system...",
          "card_html": "\n<p class=\"western\" style=\"line-height: 108%; margin-bottom: 0.11in\"><u><b class=\"western\"><font size=\"3\" style=\"font-size: 12pt\">Flight\ntesting</font></b></u><font size=\"2\" style=\"font-size: 11pt\"><u><span style=\"font-weight: normal\"><font size=\"3\" style=\"font-size: 12pt\">\n</font></span></u></font><font size=\"2\" style=\"font-size: 11pt\"><u><span style=\"font-weight: normal\">provides\n</span></u></font><u><b class=\"western\">data</b></u><font size=\"2\" style=\"font-size: 11pt\"><u>...",
          "link": "https://armedservices.house.gov/_cache/files/7/b/7bd5a9f3-9f36-4f32-8faa-1060352a25f6/7D4903AC8BC9BBE7FE075FD28F459508.hhrg-116-as29-wstate-greavess-20190508.pdf",
          "qdrant_point_id": "8e5a6e59-1975-48d0-91ac-a1e14c4d87ca",
          "total_upvotes": 0,
          "total_downvotes": 0,
          "vote_by_current_user": null,
          "created_at": "2023-07-13T04:36:56.545502",
          "updated_at": "2023-07-13T04:36:56.545504",
          "oc_file_path": null,
          "file_id": "c472d848-985a-4a0f-b166-4ab0e5c8f019",
          "file_name": "Emory-Giampetruzzi-Shaikh-Neg-Texas-Doubles (2).docx",
          "private": false,
          "verification_score": 17
        },
        //... other collisions
      ]
    },
    //... other cards
  ],
  "total_card_pages": 85
}

GET/api/card/count

Get count of cards currently in the db

This route allows you to get the total number of cards currently in the database, including collisions. It takes no attributes.

Response

If the response is successful, it will return a 200 status code with the card_count.

  • Name
    total_count
    Type
    number
    Description

    The total number of cards currently in the db.

Request

GET
/api/card/count
  curl --G 'https://api.arguflow.ai/api/card/count' \
    --header 'Content-Type: application/json'

Response

  { 
    "total_count": total_count 
  }