Pass the optional and required parameters as per the official API docs. See the DTO reference below for more information.

package com.example.myapp;

@RestController
public class APIController {

    private static IKeyService keyService = new KeyService();

    @PutMapping("/update")
    public ResponseEntity<String> updateKey(
            @RequestParam String keyId,
            @RequestBody Map<String, Object> keyUpdateRequest,
            @RequestHeader("Authorization") String authToken
    ) {
        // Delegate the creation of the key to the KeyService
        return keyService.updateKey(keyUpdateRequest, authToken, keyId);
    }
}

DTOs Reference

The DTOs used in the code for a better understanding of request and response bodies.

Request

Take the reference from the official API docs for update request parameters. Only pass the parameters you want to update.

Response

”OK”

Was this page helpful?