• Resolved emidgett1969

    (@emidgett1969)


    Hello thanks for the EndPoints plugin. I’ve been doing this in a harder way! I have created and endpoint and a secret_key. When I type the URL for the endpoint I get a general <everything worked ok> message that shows my key and that arguments I passed.

    I have created the endpoint filter using the code sample provided, and I added the missing semi colon. I have put it in functions.php for my theme, your plugin, and also using Code Snippets plugin. I still get the general <everything worked ok> message and my filter isn’t being invoked.

    Does this problem sound familiar?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter emidgett1969

    (@emidgett1969)

    Here is the log:
    Source : slapikey

    Api Secret : SjEdYqX7reGXVaSn7Ij50WthYNdmBetp

    Requested URI : https://myshitlist.app/wp-json/slapi/v1/ticketactivation?

    IP : 172.74.34.241

    Requested At : 6 Mar, 2020 2:53 AM

    Response : Connection OK

    Response Data : {“status”:”OK”,”response”:”Connection OK”,”code”:200,”data”:{“secret_key”:”SjEdYqX7reGXVaSn7Ij50WthYNdmBetp”,”token”:”38″}}

    System Info : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36

    Thread Starter emidgett1969

    (@emidgett1969)

    Here is the filter:

    add_filter(“wcra_ticketactivation_callback” , “wcra_ticketactivation_callback_handler”);
    function wcra_ticketactivation_callback_handler($param){
    //$param = All GET/POST values will be received from endpoint
    //do your stuff here
    $response = “akdfjalkdvnlaknflaknflaksnflaknsdlaknsjdlaknsdlaksjdlakjdlaksjdlaksjdlaksdj”;
    return $response;
    }

    Thread Starter emidgett1969

    (@emidgett1969)

    Plugin Author Dipankar Pal

    (@dipankarpal212)

    Hi There,

    There is no problem in your filter.
    Filter is working.

    All you need to write your won code and functionality (what the endpoint does as per your requirement) inside that filter function defined into theme.

    And return your desired data in the same function.

    I hope I have answered your query.

    Thanks for using our plugin,
    Please gives a review and ratings, as it would be inspired us to introduce more things.

    Thaks,

    Thread Starter emidgett1969

    (@emidgett1969)

    Please see my reply with the filter code. If the filter fires it should return the string

    “akdfjalkdvnlaknflaknflaksnflaknsdlaknsjdlaknsdlaksjdlakjdlaksjdlaksjdlaksdj”

    instead of the more intelligent response. This is all of my functionality for now, I will add more soon.

    Thread Starter emidgett1969

    (@emidgett1969)

    please disregard. thank you

    Plugin Author Dipankar Pal

    (@dipankarpal212)

    Hi there,
    The endpoint always return a pretty formatted response with status and code.

    The actual data would be available in the ‘data’ of the object response.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Endpoint not firing filter’ is closed to new replies.