Table of Contents

Search

  1. Preface
  2. Introduction to Edge Data Streaming Custom Entity Types
  3. Managing Custom Entity Types
  4. Custom Entities from Maven Archetypes
  5. REST APIs
  6. HTTP Request and Response Parameters
  7. Sample JSON Requests and Responses
  8. Glossary

Developer Guide

Developer Guide

Update Parameters

Update Parameters

Use the POST method to update a parameter in VDS.

POST Request in JSON Format

Generate a POST request. For example, the following POST request updates a parameter:
POST /api/parameters Content-Type: application/json Accept: application/json x-http-method-override: PUT

POST Body in JSON Format

The following a sample POST body in JSON format:
{ "parameters": [ {"parameterId": 1, "key": "TestKeyChnaged", "value": "TestValue"}, {"parameterId": 2, "key": "Key2Changed", "value": "Value2Updated", "secure": true}, ]

POST Response in JSON Format

The following are sample responses for the 200 OK code:
{ "total": 1, "count": 1, "success": true, "items": [ {"parameterId": {parameter-id}, "key": {parameter-key}, "success": true, "value": {parameter-value}, "secure": false, "timestamp": {timestamp}} } ] }
{ "total": 2, "count": 2, "success": true, "items": [ {"parameterId": {parameter-id}, "key": {parameter-key}, "success": true, "value": {parameter-value-masked}, "secure": true, "timestamp": {timestamp}}, {"parameterId": {parameter-id}, "key": {parameter-key}, "success": true, "value": {parameter-value}, "secure": false, "timestamp": {timestamp}} ] }
The following are sample responses for the 404 Not Found code:
{ "success": false, "errors": [ { "code": PARAMETER_NOT_FOUND, "parameters": [{parameter-id}], "errorMessage": "Parameter with Id: {parameter-id} not found" } ] }
The following are sample responses for the 400 Bad Request code:
{ "success": false, "errors": [ { "code": PARAMETER_ID_FIELD_NOT_FOUND, "parameters": null, "errorMessage": "'parameterId' field is missing in request" } ] }
{ "success": false, "errors": [ { "code": PARAMETER_KEY_FIELD_NOT_FOUND, "parameters": null, "errorMessage": "'key' field is missing in request" } ] }
{ "success": false, "errors": [ { "code": PARAMETER_NAME_ALREADY_EXISTS, "parameters": null, "errorMessage": "Parameter name already exists." } ] }
The following is a sample response for the 500 Internal Server Error code:
{ "success": false, "errors": [ { "code": INTERNAL_SERVER_ERROR, "parameters": [{error-message}], "errorMessage": "Failed to update parameter. Exception : {error-message}" } ] }

0 COMMENTS

We’d like to hear from you!