Reputation: 29
I am trying to make Java application that will overwrite some items just after they are created. There is not much information and examples of usage of Podio API, so I got in stuck already on hook creating and verification.
The code:
APIFactory apiFactory = new APIFactory(resourceFactory);
AppAPI appAPI = apiFactory.getAppAPI();
ItemAPI itemAPI = apiFactory.getItemAPI();
SpaceAPI spaceAPI = apiFactory.getSpaceAPI();
HookAPI hookAPI = apiFactory.getHookAPI();
int spaceId = spaceAPI.getSpaceByURL("https://podio.com/company_name/helpdesk").getId();
for (ApplicationMini app : appAPI.getAppsOnSpace(spaceId)){
if(app.getConfiguration().getName().equals("Help Desk")){
System.out.println(app.getConfiguration().getName());
HookCreate hookCreate = new HookCreate(URL, HookType.ITEM_CREATE);
Reference ref = new Reference(ReferenceType.APP,app.getId());
int hookId = hookAPI.create(ref , hookCreate);
hookAPI.requestVerification(hookId);
hookAPI.validateVerification(hookId, CODE);
break;
}
}
So my questions are:
What should be URL in HookCreate object? Podio API documentation says "The url of endpoint" and it doesn't explain much to me. It s not really clear to me also how do I get verification code
Upvotes: 0
Views: 530
Reputation: 752
There's a guide to Podio webhooks at https://developers.podio.com/examples/webhooks
It's a three step process:
Upvotes: 1