Users

On this page, we'll dive into the different user endpoints you can use to manage users programmatically.

The user model

The user model contains all the information about the user, such as their username, chat id, and scraping status. It also contains a reference to the user's listings and urls.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the user.

  • Name
    username
    Type
    string
    Description

    The username for the user.

  • Name
    scraper_status
    Type
    boolean
    Description

    The status of the user's scraper.

  • Name
    admin
    Type
    boolean
    Description

    Whether or not the user is an admin.

  • Name
    chat_id
    Type
    string
    Description

    The Telegram chat id for the user.


GET/v1/get-user-profile/

Get user profile

This endpoint allows you to retrieve the current user profile. User must be authenticated through a Bearer token.

Request

GET
/v1/get-user-profile/
curl -G https://watchdog-api.zeroruka.moe/v1/get-user-profile/ \
  -H "Authorization: Bearer {token}" \

Response

{
"username": "test1",
"user_id": 2,
"chat_id": 818971977,
"scraper_status": false
}

POST/v1/change-chat-id/

Update user's Chat ID

This endpoint allows you to update the current user's chat id. User must be authenticated through a Bearer token.

Required attributes

  • Name
    chat_id
    Type
    string
    Description

    The new chat id for the user that you want to change to.

Request

POST
/v1/change-chat-id/
curl -X PUT https://watchdog-api.zeroruka.moe/v1/change-chat-id/ \
  -H "Authorization: Bearer {token}" \
  -d chat_id=818971977

Response

{
"message": "Chat id changed successfully"
}

DELETE/v1/goodbye/

Delete user

This endpoint allows you to your account. User must be authenticated through a Bearer token.

Request

DELETE
/v1/goodbye/
curl -X DELETE https://watchdog-api.zeroruka.moe/v1/goodbye/ \
  -H "Authorization: Bearer {token}"

Response

{
"message": "User deleted successfully"
}

Was this page helpful?