Skip to content

Commit

Permalink
(Kotlin) Rotate secret should be post (#164)
Browse files Browse the repository at this point in the history
# Description

(Kotlin) Right now rotateSecret is set as PUT method, although it should
POST according to the documentation. This error gets generated when
calling the method.

```
Exception in thread "main" java.lang.IllegalArgumentException: method PUT must have a request body.
```

# License
I confirm that this contribution is made under the terms of the MIT
license and that I have the authority necessary to make this
contribution on behalf of its copyright owner.
  • Loading branch information
atejada committed Oct 25, 2023
1 parent 0157f4b commit 95d72e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/com/nylas/resources/Webhooks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Webhooks(client: NylasClient) : Resource<Webhook>(client, Webhook::class.j
fun rotateSecret(webhookId: String): Response<WebhookWithSecret> {
val path = String.format("v3/webhooks/%s/rotate-secret", webhookId)
val responseType = Types.newParameterizedType(Response::class.java, WebhookWithSecret::class.java)
return client.executePut(path, responseType)
return client.executePost(path, responseType)
}

/**
Expand Down

0 comments on commit 95d72e9

Please sign in to comment.