Post

0 followers Follow
0
Avatar

Can't see web hook validation request

Please forgive me in advance since I'm a complete noob in all things Podio, Java and Web, so here goes ...

  1. I wrote a simple program that opens a socket and listens and writes the input stream to console. Check.
  2. i requested a Web hook. Check.
  3. I hit the URL with my browser and see the input stream written to the console.
  4. GET / HTTP/1.1
    Host: me.dyndns.org:799
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
  5. I request a hook verification at the same URL. **Squat **in my console log. Huh?

 Is there something I'm missing?

Thanks.

Rich Stoldt Answered

Please sign in to leave a comment.

9 comments

0
Avatar

All web hooks use POST requests. I don't know if that changes anything, just a quick tip.

Carl-Fredrik Herö 0 votes
Comment actions Permalink
0
Avatar

Are you sure me.dyndns.org:799 is accessible for everyone? Can someone else outside your network get a response on that url? If not, then the Podio API can't either, and then you can't verify your web hook.

Casper Fabricius 0 votes
Comment actions Permalink
0
Avatar

Carl -

I would imagine that I'd see the POST in the input stream.  If I telnet to that port I see anything I type echoed, but perhaps that makes a difference.  i'm just doing this:

  public static void main(String args[]) throws Exception {

    ServerSocket ssock = new ServerSocket(799);

    Socket sock = ssock.accept();

    BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream()));

    String line;

    while ((line = in.readLine()) != null) {

      System.out.println(line);

    }

Like I mentioned, I'm shooting blind here.

Casper -

Yes - the real URL is rstoldt.dyndns.org:799 and it is accessible from anywhere.

Rich Stoldt 0 votes
Comment actions Permalink
0
Avatar

Ok, it seems your program reads all the headers which should, as you say, be there even with a post request.

Carl-Fredrik Herö 0 votes
Comment actions Permalink
0
Avatar

Rich, I have no idea why you would be doing this with a manuel socket. If you've never done web development before perhaps you should start by getting a basic ASP.NET MVC site up and running on a public server or something, and then take it from there. I really can't say why you program isn't writing to your log.

Casper Fabricius 0 votes
Comment actions Permalink
0
Avatar

This is strictly a science project - it's not intended for any practical use other than to see what the traffic looks like and to be able to validate a hook.

Any thoughts on how to determine if the validation request got fired/received would be appreciated.  Give a fellow CITRITE a break :)

Rich Stoldt 0 votes
Comment actions Permalink
0
Avatar

Start by removing all the non-standards. So setup a webserver and make it available on port 80. If that works start reintroducing your non-standards one-by-one. E.g. switch back to port 799, then switch back to your socket script.

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

So I finally got my listener working and can see the request:

Client data content type application/x-www-form-urlencoded

Client data content length 44

Start of client data:

hook_id=21690&code=??????????&type=hook.verify

End of client data:

How should the reply string be formatted?

Rich Stoldt 0 votes
Comment actions Permalink
0
Avatar

The reference documentation is here: https://developers.podio.com/doc/hooks/validate-hook-verification-215241 

So you can see you need to do a POST request to /hook/{hook_id}/verify/validate (where {hook_id} is your hook_id) and the request body needs to be the JSON in the example:

{"code": "YOUR_VERIFICATION_CODE_HERE"}

If you are doing things manually remember to set the appropriate headers. E.g. content-length and content-type to application/json

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink