Update Service Name
This API endpoint allows you to update the name of a service by providing its ID as a path parameter and the new service name in the request body. This operation is essential for keeping your service names up to date and relevant within your system.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:

  • On success, the service name will be updated, and a confirmation message will be returned.
  • If the request is unauthorized, an error message indicating authorization failure will be returned. If the request is invalid or contains incorrect data, a message specifying the issues will be provided.
Path Parameters
  • id string
    The unique service ID to update.
    Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
Request Body Parameters
  • name string
    The new name of the service.
    Example: 'ServiceName'
JavaScript
Response codes
const axios = require('axios');

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

axios.put(url, data, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.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).