csharp-rest-api icon indicating copy to clipboard operation
csharp-rest-api copied to clipboard

Webhook Error converting value "rejected" to type 'MessageBird.Objects.Conversations.ConversationMessageStatus

Open ZEDTransforms opened this issue 5 years ago • 0 comments

Using newtonsoft to deserialize a webhook in response to sending a whatsapp message we get the error

Newtonsoft.Json.JsonSerializationException: Error converting value "rejected" to type 'MessageBird.Objects.Conversations.ConversationMessageStatus'. Path 'message.status', line 64, position 24. ---> System.ArgumentException: Requested value 'rejected' was not found.

{ "contact": { "attributes": {}, "createdDatetime": "2021-01-08T11:06:38Z", "customDetails": {}, "firstName": "", "lastName": "", "updatedDatetime": "2021-01-08T11:06:38Z" }, "conversation": { "contactId": "cc7c35b3bbc841438ba5880f3743b06d", "createdDatetime": "2021-01-08T11:06:38Z", "id": "f8fece0fc39f46a7a8f9a44ec5b54b9e", "lastReceivedDatetime": "2021-01-08T11:06:39.17314366Z", "lastUsedChannelId": "97162e4022fd41dda3cbb4f86a083dc3", "lastUsedPlatformId": "whatsapp", "status": "active", "updatedDatetime": "2021-01-08T11:06:39.189118227Z" }, "message": { "content": { "hsm": { "language": { "code": "en", "policy": "deterministic" }, "params": [ { "default": "2 Garden" }, { "default": "Saturday, 09/01" } ], "templateName": "sendpincode" } }, "createdDatetime": "2021-01-08T11:06:39Z", "direction": "sent", "error": { "code": 302, "description": "The contact is not registered on WhatsApp." }, "origin": "api", "platform": "whatsapp", "status": "rejected", "type": "hsm", "updatedDatetime": "2021-01-08T11:06:39Z" }, "type": "message.updated" }

ZEDTransforms avatar Jan 08 '21 12:01 ZEDTransforms