Delete Service
This API endpoint allows you to delete a service by providing its ID as a path parameter. This action is crucial for maintaining an organized service list in your system.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:

  • On success, the service will be deleted, and a confirmation message will be returned.
  • If the request is unauthorized, an error message will indicate authorization failure. If the service ID is invalid or not found, a message specifying the issue will be provided.
Path Parameters
  • id string
    The unique service ID to delete.
    Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-cmd.api.pinghome.io/v1/service/c03b02ec-244f-4d2c-8f68-3910071ed5c8';

axios.delete(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.then(response => {
  console.log('Service deleted successfully');
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).