Community

Community Forums

Where our customers, developers, and more can come together to help each other with both general and technical questions about our products and services.

[cannot enable open channel] webhook has been well established but still cannot ennale open channel

mikko cheng

Dear airship support team,

I am currently learning how to use your open channel to send notifications to my phone. But I encountered an error and couldn't carry on. Here is the issue detail:

1. I have established a webhook according to the your guide.

when i request <webhook_url>/validate, i can get the valid response.

2.But when i enable the new open channel on your website, i got http 500 error:

when i open the chrome development tool with F12, I got this hint:

 

Since i don't know what is the root problem, I don't what should I do next. Plz help.

Kind regards,

Mikko

Official comment

Avatar

Hi Mikko,

Jay from Technical Support here. We'd be happy to take a look.

What's the App Key for your project? 

And would you be able to share your code and what your webhook is returning in response?

Thanks,

Jay M.
Airship Technical Support

Jay M.
Comment actions Permalink

Please sign in to leave a comment.

0
Avatar

Hi Jay,

thanks very mach for your reply. Below is the information you requested in your response:

1)App Key:oDloRXtjROODBQKwfzJxbA

2)  Validation Code:

3) what webhook is returning in response:

Please help to further confirm the cause of the problem,Thanks.

Mikko Cheng.

mikko cheng 0 votes
Comment actions Permalink
0
Avatar

Hey Mikko,

When I try to validate on my end, your server isn't returning anything, which I assume is likely that you have to run it when you test and it isn't always on perhaps. If that isn't the case, let me know. 

Otherwise, I'd recommend making sure that your validation response includes the following:

  • Return a 200 response code.
  • Return a Content-Type of "application/json".
  • Return a JSON body with the confirmation code in the following format: {"confirmation_code":"bf93d646-c8ff-42c9-8de2-86519880581c"}.

Be sure that the body is valid JSON and returns the confirmation_code generated for the webhook in the Airship Dashboard.

I've seen cases where the return body wasn't formatted correctly and while it looks fine in postman, it wasn't proper JSON or had incorrect charecters. 

Jay M. 0 votes
Comment actions Permalink
0
Avatar

Hi Jay,

1) Although my webhook sometimes stops automatically, every time I click the "enable" button on the open channel configuration page, I can confirm that the webhook is running.

2) Return a 200 response code—— √

3)Return a Content-Type of "application/json".—— √

4)Return a JSON body with the confirmation code in the following format: {"confirmation_code":"bf93d646-c8ff-42c9-8de2-86519880581c"}.—— √

 

Everything looks good. And also I verified the returned body with a tool, and it turned out that it was a valid JSON string. 

In addition, the value of the confirmation_code in the body is the same as that generated by the airship.

Also, I changed the webhook url. The next time you try to call this API, remember to add port 8080 to the end of the original URL. Also, I changed the webhook url. The next time you try to call this API, remember to add port 8080 at the end of the original URL, that is, https://www.jrr.ink:8080. I will keep my server running for the next few days.

Kind regards.

mikko cheng 0 votes
Comment actions Permalink
0
Avatar

I'm still unable to connect to the server, even with the https://www.jrr.ink:8080 url. 

Can you verify the server is active?

Also, would you be able to share the code your webhook uses to generate the response?

Thanks,

Jay M.
Airship Technical Support

Jay M. 0 votes
Comment actions Permalink
0
Avatar

Hey Jay,

1)I'm sorry the server is not running again. Now I have completely solved the problem. From now on, the server will always be running.

2)Below is the code my webhook uses to  to generate the response.

 

mikko cheng 0 votes
Comment actions Permalink
0
Avatar

Thanks for sending your code.

I am still unable to connect, it is now timing out. Is this running locally? I'm also curious about the use of the port. 

 

Jay M. 0 votes
Comment actions Permalink
0
Avatar

Hi Jay,

My webhook is running on a AWS EC2 instance not local. 

As for the port, I  can normally access the validate interface without adding the port after the URL before, but I still cannot enable the open channel at that time.

mikko cheng 0 votes
Comment actions Permalink
0
Avatar

Hi Jay,

I am a colleague of Mikko. We are trying to use Airship, please deal with the questions raised by Mikko.

Best regards,

Super Song

Super Song 0 votes
Comment actions Permalink
0
Avatar

Hey folks,

I have just created a new webhook of my own to test this and I am able using postman to get a response from it (as well as enable the open channel in Airship) whereas I am still unable to get a response from your server using the exact same call just changing the domain to your webhook url (with or without the port). 

That indicates that something about how the server is set up or what it's response is not set up correctly. 

You can test this by setting up a test webhook with another service (like https://beeceptor.com/). 

Jay M.
Airship Technical Support

Jay M. 0 votes
Comment actions Permalink
0
Avatar

Hey Jay,

We migrated the webhook software to another German server and everything worked fine. The problem has now been resolved. Thank you very much for your patience during this time.

Thank you!

mikko cheng 0 votes
Comment actions Permalink
0
Avatar

Wonderful! I'm glad to hear it's working.

Jay M.
Airship Technical Support

Jay M. 0 votes
Comment actions Permalink
0
Avatar

As a reminder, now that you've got this to work, please be sure to create a new webhook to generate a new confirmation code as this one has been posted on this forum publicly. 

Jay M. 0 votes
Comment actions Permalink
0
Avatar

OK, we will take your suggestion. Thank you vey much!

mikko cheng 0 votes
Comment actions Permalink