Home Forums Newsletter Developers Can't Subscribe using REST API, always "Email address not valid"

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #242177
    jarson
    Participant

    Hi!

    I’m trying to add Subscribers from my website’s form running on Gatsby.js with WP as CMS.

    I send this to http://[website]/wp-json/newsletter/v1/subscribe via POST
    {"email":"test@example.com","api_key":"[key]"}

    I receive:
    {"code":-1,"message":"Email address not valid","data":{"status":400}}

    What could be wrong here?

    • This topic was modified 1 year, 3 months ago by jarson.
    #242216
    jarson
    Participant

    OK, I’ve resolved the issue – trivial mistake in header data

    Everything is working as expected now.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.