# Can't validate event notification endpoint URL

**URL:** <https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380>\
**Category:** Meetings\
**Created:** [December 16, 2022, 5:20am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380 "2022-12-16T05:20:43Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![ym.engineering](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ym.engineering/32/48825_2.png) [@ym.engineering](https://devforum.zoom.us/u/ym.engineering)\
**Post date:** [June 9, 2023, 8:43pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/22 "2023-06-09T20:43:13Z")

</div>

Our web services are .NET using ServiceStack.

---

<div class="post-metadata">

**Author:** ![ym.engineering](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ym.engineering/32/48825_2.png) [@ym.engineering](https://devforum.zoom.us/u/ym.engineering)\
**Post date:** [June 9, 2023, 9:01pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/23 "2023-06-09T21:01:27Z")

</div>

Hey Elisa. Yes, we are still having issues validating our endpoint (endpoint.url\_validation) and would appreciate any assistance.

Our web service Ams/ZoomEventListenerOAuth is written in .NET C# and uses the ServiceStack framework to handle the http request/response. Questions:

1. What is the proper JSON structure of the http response body? Is it

```auto
{"plainToken":"qgg8...FL8Aw", "encryptedToken":"426b6...d0200"}

```

or

```auto
{"message":{"plainToken":"qgg8...FL8Aw","encryptedToken":"426b6...d0200"},"status":200}

```

1. Is our web service Ams/ZoomEventListenerOAuth generating the correct “encryptedToken” value of “426b6261eae90ccda682afd4444d021c00d5179396020793424cab15815d020” given the following input?

2. Is there anything else Zoom is checking on the http response that is causing it to fail validation? (e.g. SSL certificate is not from a trusted publisher, or TLS 1.2+ is not being used, etc.)

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [June 12, 2023, 2:28pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/24 "2023-06-12T14:28:45Z")

</div>

Hi @ym.engineering  
this is the proper JSON structure:

{“plainToken”:“qgg8…FL8Aw”, “encryptedToken”:“426b6…d0200”}

---

<div class="post-metadata">

**Author:** ![ym.engineering](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ym.engineering/32/48825_2.png) [@ym.engineering](https://devforum.zoom.us/u/ym.engineering)\
**Post date:** [June 12, 2023, 8:21pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/25 "2023-06-12T20:21:02Z")

</div>

Thanks, @elisa.zoom , for verifying the JSON structure in question 1. Any insight on questions 2 and 3 above?

---

<div class="post-metadata">

**Author:** ![vladimir.rivera](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@vladimir.rivera](https://devforum.zoom.us/u/vladimir.rivera)\
**Post date:** [June 20, 2023, 3:54pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/26 "2023-06-20T15:54:51Z")

</div>

Hi, I just let you know the validations is working , using the below code in C#:

[FunctionName(“Events”)]  
public static async Task Run(  
[HttpTrigger(AuthorizationLevel.User, “post”)] HttpRequest req,  
ILogger log)  
{  
log.LogInformation(“C# Zoom Webhook function processed a request.”);

```
        log.LogInformation("C# HTTP trigger function processed a request.");

        string hashed = "";
        string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
        var data = JsonConvert.DeserializeObject<ZoomWebhookPayload>(requestBody);

        if (!(string.IsNullOrEmpty(data.Event)) && data.Event == "endpoint.url_validation")
        {
            var encoding = new System.Text.ASCIIEncoding();
            var sha256 = new System.Security.Cryptography.HMACSHA256();
            sha256.Key = encoding.GetBytes("My_TOKEN_SECRE_HERE");
            var hash = sha256.ComputeHash(encoding.GetBytes(data.payload.plainToken));
            hashed = ToHex(hash, false);
        }
        return new OkObjectResult(new
        {
            plainToken = data.payload.plainToken,
            encryptedToken = hashed
        });
    }
    
    private static string ToHex(byte[] bytes, bool upperCase)
    {
        StringBuilder result = new StringBuilder(bytes.Length * 2);
        for (int i = 0; i < bytes.Length; i++)
            result.Append(bytes[i].ToString(upperCase ? "X2" : "x2"));
        return result.ToString();
    }
    protected class ZoomWebhookPayload
    {
        public ZoomWebhookEventPayload payload { get; set; }
        public string Event { get; set; }
    }

    protected class ZoomWebhookEventPayload
    {
        public string plainToken { get; set; }

    }

```

---

<div class="post-metadata">

**Author:** ![arkarthi2006](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/arkarthi2006/32/49069_2.png) [@arkarthi2006](https://devforum.zoom.us/u/arkarthi2006)\
**Post date:** [June 30, 2023, 9:27am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/27 "2023-06-30T09:27:38Z")

</div>

Hi Naeem,

I want to get zoom webhook event in .net framework API. How to implement it?

Thanks,

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [June 30, 2023, 9:50am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/28 "2023-06-30T09:50:53Z")

</div>

> [@freelancer.nak](#):
>
> ```auto
> [HttpPost(Name = "events")]
> public ActionResult Events(ValidateUrlEvent notification)
> {
> var encoding = new System.Text.ASCIIEncoding();
> 
> var sha256 = new System.Security.Cryptography.HMACSHA256();
> sha256.Key = encoding.GetBytes("Your Event Secret Token");
> 
> var hash = sha256.ComputeHash(encoding.GetBytes(notification.payload.plainToken));
> 
> var hashed=ToHex(hash,false);
> 
> return Ok(
> new
> {
> plainToken = notification.payload.plainToken,
> encryptedToken = hashed
> }
> );
> }
> 
> private static string ToHex(byte[] bytes, bool upperCase)
> {
> StringBuilder result = new StringBuilder(bytes.Length * 2);
> for (int i = 0; i < bytes.Length; i++)
> result.Append(bytes[i].ToString(upperCase ? "X2" : "x2"));
> return result.ToString();
> }
> 
> ```

@arkarthi2006 Hi, please get 👆 the working C#.Net REST Endpoint code for Zoom Webhook Validation. Thanks

---

<div class="post-metadata">

**Author:** ![arkarthi2006](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/arkarthi2006/32/49069_2.png) [@arkarthi2006](https://devforum.zoom.us/u/arkarthi2006)\
**Post date:** [June 30, 2023, 10:14am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/29 "2023-06-30T10:14:30Z")

</div>

[quote=“Naeem Ahmed, post:9, topic:80380, username:freelancer.nak”]  
`ValidateUrlEvent `  
ValidateUrlEvent is custome event or c# library?

---

<div class="post-metadata">

**Author:** ![onemancat](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@onemancat](https://devforum.zoom.us/u/onemancat)\
**Post date:** [June 30, 2023, 8:52pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/30 "2023-06-30T20:52:52Z")

</div>

Thanks for this solution. This looks [asp.net](http://asp.net) core. And it does work. However, I have [asp.net](http://asp.net) mvc (.net framework) and i have tried many ways to return the data and it just does not work. The encryption and all don’t seem to be the issue. Anyone got it working with framework?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [July 2, 2023, 11:18am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/31 "2023-07-02T11:18:25Z")

</div>

@arkarthi2006 It is a custom class with Payload of Zoom Webhook validation request.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [July 2, 2023, 11:25am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/32 "2023-07-02T11:25:31Z")

</div>

Here is complete `.Net Core (C#)` code

**ZoomController.cs**

```auto
using Microsoft.AspNetCore.Mvc;
using System.Text;

[ApiController]
[Route("[controller]")]
public class ZoomController : ControllerBase
{

    [HttpGet(Name = "Test")]
    public ActionResult ZoomT()
    {
        return Ok();
    }

    [HttpPost(Name = "events")]
    public ActionResult Events(VerificationTokenEvent notification)
    {
        var encoding = new System.Text.ASCIIEncoding();

        var sha256 = new System.Security.Cryptography.HMACSHA256();
        sha256.Key = encoding.GetBytes("YAR-Yg7rXT-Ofcd9KrX1p3Q");

        var hash = sha256.ComputeHash(encoding.GetBytes(notification.payload.plainToken));

        var hashed=ToHex(hash,false);

        return Ok(
            new
            {
                plainToken = notification.payload.plainToken,
                encryptedToken = hashed
            }
        );
    }

    private static string ToHex(byte[] bytes, bool upperCase)
    {
        StringBuilder result = new StringBuilder(bytes.Length * 2);
        for (int i = 0; i < bytes.Length; i++)
            result.Append(bytes[i].ToString(upperCase ? "X2" : "x2"));
        return result.ToString();
    }
}

```

Here are custom Classes 👇

_ **ZoomEvents.cs** _

```auto
public class VerificationTokenEvent
{
    public Payload payload { get; set; }

}

public class Payload
{
    public string plainToken { get; set; }
}

```

---

<div class="post-metadata">

**Author:** ![arkarthi2006](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/arkarthi2006/32/49069_2.png) [@arkarthi2006](https://devforum.zoom.us/u/arkarthi2006)\
**Post date:** [July 4, 2023, 6:27am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/33 "2023-07-04T06:27:02Z")

</div>

Thanks for your reply. Your code was working fine in c#. But it was returned as below,

“URL validation failed. Try again later.”

My code is as below,

[HttpPost]  
[Route(“ReceiveEvent”)]  
public async Task ReceiveEvent(ZoomWebhookPayload notification)  
{  
try  
{

```
	var encoding = new System.Text.ASCIIEncoding();
	var sha256 = new System.Security.Cryptography.HMACSHA256();
	sha256.Key = encoding.GetBytes("My Secret Token here");
	var hash = sha256.ComputeHash(encoding.GetBytes(notification.payload.plainToken));
	var hashed = ToHex(hash, false);
	var validationResponse = new
	{
		message = new
		{
			plainToken = notification.payload.plainToken,
			encryptedToken = hashed

		},

		status = 200
		};
		return Ok(validationResponse);				
	}
     catch (Exception ex)
        {
            return BadRequest(ex.Message);
        }
    }

```

public class ZoomWebhookPayload  
{  
public ZoomWebhookEventPayload payload { get; set; }  
public string Event { get; set; }  
}  
public class ZoomWebhookEventPayload  
{  
public string plainToken { get; set; }

```
}

```

Anything I missed?

---

<div class="post-metadata">

**Author:** ![deepscaladev](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/deepscaladev/32/53147_2.png) [@deepscaladev](https://devforum.zoom.us/u/deepscaladev)\
**Post date:** [October 19, 2023, 11:44am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/34 "2023-10-19T11:44:43Z")

</div>

Hi guys facing the same issue i have put an error log on the very first line of code to check but its not even logging an error.  
Please assist me  
language I’m using is Laravel  
I’m also attaching the code and error  
here is the link to screenshots

> **[de hosted at ImgBB](https://ibb.co/z6L07M2)**
>
> Image de hosted in ImgBB

> **[urlissue hosted at ImgBB](https://ibb.co/xMjMGPR)**
>
> Image urlissue hosted in ImgBB

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [October 22, 2023, 12:00pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/35 "2023-10-22T12:00:27Z")

</div>

I hope you’re doing well.

Please send a response as like 👇

```auto
      {
                plainToken = 'notification.payload.plainToken',
                encryptedToken = hashed
 }

```

---

<div class="post-metadata">

**Author:** ![MrMustafa](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mrmustafa/32/43492_2.png) [@MrMustafa](https://devforum.zoom.us/u/MrMustafa)\
**Post date:** [December 4, 2023, 8:15pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/36 "2023-12-04T20:15:35Z")

</div>

How to return Ok() with anynonmous type in ActionResult

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [December 5, 2023, 7:22am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/37 "2023-12-05T07:22:23Z")

</div>

Like this 👇

```auto
public ActionResult Test(string code)
{
            return Ok(new
            {
                plainToken = "",
                encryptedToken = ""
            });
}

```

---

<div class="post-metadata">

**Author:** ![MrMustafa](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mrmustafa/32/43492_2.png) [@MrMustafa](https://devforum.zoom.us/u/MrMustafa)\
**Post date:** [December 5, 2023, 8:10am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/38 "2023-12-05T08:10:18Z")

</div>

I get this error:  
Cannot implicitly convert type ‘System.Web.Http.Results.OkNegotiatedContentResult\<\<anonymous type: string plainToken, string encryptedToken\>\>’ to ‘System.Web.Mvc.ActionResult’

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [December 5, 2023, 8:57am UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/39 "2023-12-05T08:57:25Z")

</div>

try to return IHttpActionResult

---

<div class="post-metadata">

**Author:** ![MrMustafa](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mrmustafa/32/43492_2.png) [@MrMustafa](https://devforum.zoom.us/u/MrMustafa)\
**Post date:** [December 6, 2023, 3:35pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/41 "2023-12-06T15:35:07Z")

</div>

Hello, are you get solution in [asp.net](http://asp.net) mvc (.net framework) ??  
I need it too please

---

<div class="post-metadata">

**Author:** ![vishwajeetbhosale](https://avatars.discourse-cdn.com/v4/letter/v/f19dbf/32.png) [@vishwajeetbhosale](https://devforum.zoom.us/u/vishwajeetbhosale)\
**Post date:** [December 11, 2023, 3:32pm UTC](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380/43 "2023-12-11T15:32:19Z")

</div>

Hi @MrMustafa, here is the .Net Core code and it will help you to get validate the event notification URL.  
**If testing locally:** After testing of values are get passed properly don’t use breakpoint, if it takes time to respond then URL get invalid.  
Your URL should be serve with **https** not with http

```auto
var encoding = new System.Text.ASCIIEncoding();

                var sha256 = new System.Security.Cryptography.HMACSHA256();
                sha256.Key = encoding.GetBytes(ZoomSDKSecretToken);

                var hash = sha256.ComputeHash(encoding.GetBytes(root.payload.plainToken));
                var hashed = ToHex(hash, false);

                return Ok(
                    new
                    {
                        plainToken = root.payload.plainToken,
                        encryptedToken = hashed
                    }
                );

public string ToHex(byte[] bytes, bool upperCase)
        {
            StringBuilder result = new StringBuilder(bytes.Length * 2);
            for (int i = 0; i < bytes.Length; i++)
                result.Append(bytes[i].ToString(upperCase ? "X2" : "x2"));
            return result.ToString();
        }

```

[Previous page](https://devforum.zoom.us/t/cant-validate-event-notification-endpoint-url/80380.md?page=1)
