php - Validate webhook from Podio -


I am creating a PHP script to integrate with podio .. I think I'm fine, but I Can not verify the webhook from the Podio website .. Can you tell me what I am doing wrong? This is my code:

  need_once '../lib/Podio/PodioAPI.php'; Need_once '../lib/Podio/__cfg.php'; Podio :: Setup (CLIENT_ID, CLIENT_SECRET); If (! Podio :: is_authenticated ()) {Podio :: authenticate ('app', array ('app_id' = & gt; APP_ID, 'app_token' = & gt; APP_TOKEN)); } If ($ _POST) {Switch ($ _POST ['type']) {case 'item.create': $ item = PodioItem :: get ($ _ POST ['item_id']); DoMyStuff ($ item 'create'); break; Case 'item.update': $ item = PodioItem :: find ($ _ POST ['item_id']); DoMyStuff ('Update', $ item); break; }}    

You must add the case to verify your webhoc:

  case 'hook Verify ': Podhihoke :: Validate ($ _ POST [' hook_id '], array (' code '= & gt; $ _POST [' code '])); break;   

Try it out, I'm sure this will work!

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -