Use the Auto-generated API

Let your users manage thier rows with POST, GET, PUT, and DELETE requests while tracking your tenant's usage with the auto-generated API.

  • Alexandro Martínez
    Author
    by Alexandro Martínez
    10 months ago
  • Requirements:

    Goals:

    • Create an API Key

    • GET: List all the tasks

    • POST: Create a task

    • GET: Get a specific task

    • PUT: Update a task

    • DELETE: Delete a task

    • View the API Key Logs

    Steps

    💿 Go to the /app/acme-corp-1/settings/api/keys/new to create an API Key with /tasks permissions.

    Created API Key

    💿 Install Thunder Client for VS Code.

    💿 Create a GET request with the following values:

    💿 Click Send.

    You should get all the tasks in JSON format:

    GET - List all tasks

    💿 Before making a POST request to create a task, go to /app/acme-corp-1/projects, click on Edit on any project row and copy the ID from the URL.

    It should look something like this: cl3me5utq3138gohsoss1mqyv.

    💿 Create a POST request with the following values:

    Set the following JSON values:

    {
      "project": "cl3tlewvp2739e7hsz7apld93",
      "order": 2,
      "name": "Task 2",
      "dueDate": "2022-12-31",
      "priority": "High",
      "completed": false,
      "attachments[]": [
        {
          "name": "My image.png",
          "type": "image/png",
          "title": "My image",
          "file": "https://via.placeholder.com/1000x500.png?text=My%20image"
        }
      ],
    }
    

    You should get a 201 - Created response.

    POST - Create task

    💿 Grab de ID, and make a GET request:

    PUT - Get task

    💿 Now, let's update the Task with a PUT request.

    JSON body:

    {
      "name": "New task name"
    }
    
    PUT - Update task

    💿 Delete the Task:

    DELETE - Delete task

    💿 Finally, view the API Key logs.

    API Key Logs

    I hope this quick guide was useful! Let me know if you have any questions.

    We respect your privacy.

    TLDR: We use cookies for language selection, theme, and analytics. Learn more.