Guide Page Rest API

Dragon Ball - API Usage Guide

Steps to Use the API

  1. Copy the API Link
    Start by copying the link to the API documentation.

  2. Make Requests Using Axios
    Use Axios to send requests to the API. Install Axios if you haven't already:

    npm install axios
  3. Performing HTTP Requests
    You can perform various operations using different HTTP methods:

    • GET Request: Retrieve data from the server.

      axios.get('API_ENDPOINT')
        .then(response => console.log(response.data))
        .catch(error => console.error(error));
    • POST Request: Send data to the server to create a new entry.

      axios.post('API_ENDPOINT', { key: 'value' })
        .then(response => console.log(response.data))
        .catch(error => console.error(error));
    • PUT Request: Update an existing entry completely.

      axios.put('API_ENDPOINT/id', { key: 'updatedValue' })
        .then(response => console.log(response.data))
        .catch(error => console.error(error));
    • PATCH Request: Update an existing entry partially.

      axios.patch('API_ENDPOINT/id', { key: 'newValue' })
        .then(response => console.log(response.data))
        .catch(error => console.error(error));
    • DELETE Request: Remove an entry from the server.

      axios.delete('API_ENDPOINT/id')
        .then(response => console.log(response.data))
        .catch(error => console.error(error));
  4. Contribute to the API
    If you're an admin and need to perform administrative actions, you can obtain a token:

    axios.post('API_ENDPOINT/GetTokenAdmin', { username: 'yourUsername', password: 'yourPassword' })
      .then(response => {
        const token = response.data.token;
        // Use this token for subsequent requests
      })
      .catch(error => console.error(error));
  5. Using Authentication for Admin Actions
    For any admin-specific actions, include the token in the authorization header:

    axios.delete('API_ENDPOINT/id', { headers: { Authorization: \`Bearer \${token}\` } })
      .then(response => console.log(response.data))
      .catch(error => console.error(error));

User Reviews

Users are encouraged to provide feedback. You can submit your review Anoynymous-FeedBack (opens in a new tab).

Chat with Me

If you have any questions or need assistance, feel free to chat with me at WhatsGram (opens in a new tab).
My ID: shardendu@gmail.com