Forum

Thread tagged as: Addons, Api

Post Perch content to an external API

Hi,

I'm trying to figure out if the following is feasible and how it would be achieved in Perch.

I have a custom content item called Jobs. I want to detect when a new job is added and extract the data associated with this content item and post it to a 3rd party API.

My thought process at the moment is that I would need to create an App and use the "region.add_item" event, from this I would somehow need to establish the item added and it's properties?

I can then use this to post data to an external URL.

Can anyone clarify that this is feasible?

Is my hypothetical approach outlined above the correct way to go about this?

Can anyone provide any pointers on how to approach this?

I have never created an App before or used the API so any help would be greatly appreciated. I've downloaded the sample App and the documentation here https://docs.grabaperch.com/api/sample-app/ mentions a guide, but I can't seem to find this guide, can anyone point me to it?

Many thanks

Lee

Lee Goodman

Lee Goodman 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's the approach I'd take. It doesn't need a full app with UI and so on, just register an event listener and go from there.

Your callback will be handed the region item that was added, which you can then inspect.

Thanks Drew, apologies for the long delay in responding but could you point me to the guide mentioned in the link above?

Many thanks

Lee

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think that guide exists - I'm not aware of it.

Ok no worries, thanks Drew