Skip to content

Webhooks API: getWebhook throws: Invalid value for 'type', must be one of 'marketing', 'transac' #243

Closed
@VitaliiTsilnyk

Description

@VitaliiTsilnyk

Looks like the GetWebhook model is incorrect. It expects marketing and transac as possible values for the type property, but the actual API returns transactional.

Steps to reproduce:

  1. Create a webhook using the createWebhook request with transactional type, any other data seems irrelevant. Receive the webhook ID.
  2. Request the webhook info using the getWebhook and get an exception (example below)

Exception:

Exception 'InvalidArgumentException' with message 'Invalid value for 'type', must be one of 'marketing', 'transac'' 

in /var/www/html/vendor/sendinblue/api-v3-sdk/lib/Model/GetWebhook.php:404

Stack trace:
#0 /var/www/html/vendor/sendinblue/api-v3-sdk/lib/ObjectSerializer.php(316): SendinBlue\Client\Model\GetWebhook->setType('transactional')
#1 /var/www/html/vendor/sendinblue/api-v3-sdk/lib/Api/WebhooksApi.php(702): SendinBlue\Client\ObjectSerializer::deserialize(Object(stdClass), '\\SendinBlue\\Cli...', Array)
#2 /var/www/html/vendor/sendinblue/api-v3-sdk/lib/Api/WebhooksApi.php(643): SendinBlue\Client\Api\WebhooksApi->getWebhookWithHttpInfo(######)
...

Response returned by the API:

{
  "url": "http://#####################",
  "id": ######,
  "description": "############",
  "events": [
    "unsubscribed"
  ],
  "type": "transactional",
  "createdAt": "2022-12-08T11:23:55.000+01:00",
  "modifiedAt": "2022-12-08T11:23:55.000+01:00"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions