Jump to content

Handling a callback from an API


Recommended Posts

I'm in the process of developing a module, that will need to handle callbacks from the third-party API.

The pages for the callback will need to be accessible from frontend without a login, what's the best way to handle this from a module. Is it possible to do without manually creating the pages... I guess some sort of registering a URL that processwire will send to the module to do the processing

Link to comment
Share on other sites

  • 2 weeks later...

So I've got the URL Hooks working wonderfully! makes it really easy to create some custom logic to handle things

At the moment, I'm using a mixture of urlSegments (for one route e.g. /shop) and urlHooks (for the backend json stuff at /api/<stuff here>).

Is it possible to use the urlHooks to create a something similar to the urlSegments. I see in the documentation you can return a page, but is it possible to create the hooks function that would get a template and do the necessary before returning that to the user? I guess something similar to the way the an admin module can use views for the pages, and the function just pushes the data into that page.

Hopefully that makes sense! 🤔

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...