Giter Club home page Giter Club logo

Comments (4)

tomharrigan avatar tomharrigan commented on September 15, 2024

Hey, it should work out of the box if it's set up correctly in the Amazon developer portal. If you visit the URL directly, a 404 is expected (the URL is set up to work with a GET request rather than a POST request), but I tested out your URL with a GET request and got the same response.

A couple of questions to help diagnose the issue:
What version of PHP is your site running on? (If it's 5.3, there's a fix that I'm working on)
Have you tried re-saving the permalinks? (this can be done from Settings -> Permalinks)
Are you able to view the error logs of your site?

from voicewp.

gehwissenlos avatar gehwissenlos commented on September 15, 2024

I didn't try to enter it in the developer portal after it didn't work in my browser. If I visit the URL directly this should also be a GET request.

The plugin is not activated anymore, so you can't use the link above anymore.

The site is running 7.0.15 and I tried re-saving the permalinks but didn't work.

from voicewp.

tomharrigan avatar tomharrigan commented on September 15, 2024

You're right, my confusion on the GET/POST request mixup.

Anyway, hitting the URL directly is going to fail because it only accepts requests from Alexa.

If you just want to check that the plugin is creating the endpoints, replace the alexawp_news_request() function in alexawp.php with: https://gist.github.com/tomharrigan/9f515b56dff3865a42945172bc66052c

The above just comments out the validation checks.

On line 126 of the same file, add 'GET' to the methods parameter:
register_rest_route( 'alexawp/v1', '/skill/news', [ 'callback' => [ $this, 'alexawp_news_request' ], 'methods' => [ 'GET', 'POST' ], ] );

The response you should see in browser is {"version":"1.0","response":{"outputSpeech":{"type":"PlainText","text":"Protocol isn't secure. Request isn't from Alexa."},"shouldEndSession":true},"sessionAttributes":[]}

from voicewp.

tomharrigan avatar tomharrigan commented on September 15, 2024

Feel free to reopen. Any progress is specific to your input.

from voicewp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.