Перейти к основному контенту

How to Write API Requests Using Cursor AI

Cursor AI is a popular development tool and IDE that can use language models to generate scripts.

qBUUT07MQkNWRj3k-izobrazenie.png

For best results, you’ll need either a paid version of Cursor or an API key for ChatGPT / DeepSeek or other chatbots.

To make Cursor aware of the JumpServer API documentation, you need to:

  1. Download the swagger.json file from:
    https://PAM/api/swagger.json, where PAM is the hostname or IP address of your JumpServer.

  2. Create a new working directory for Cursor, where the generated scripts will be stored, and copy the swagger.json file into this directory.

  3. After that, ask Cursor to generate the script you need based on the API documentation in swagger.json.
    You can write your requests in Russian in free form, for example:
    “In a separate file, create a script that outputs all users, their roles, and the names of their organizations.”