Skip to content

Getting the API response after doing a subscribe

edited May 2015 in Questions

Hello,

I realize this maybe more of a PHP question then a Sendy question, but after a lot of searching I'm just stuck.

Using the example provided on the Sendy API page I am able to subscribe an email no problem. However the example never shows how to handle cases where the email is invalid or is already subscribed and how to get the response that is sent back.

From the searching I have done online I thought that the response would be in $http_response_header, but when doing var_dump I don't see anything withing $http_response_header that holds the error message. Below is the string after doing var_dump on $http_response_header as well as my current code.

Thanks.

Comments

  • Hi,

    The 'subscribe' API returns a plain text response. As written in the API page, here are all the responses:

    I suggest downloading the example scripts to explore usage:

    Thanks.

    Best regards,
    Ben

This discussion has been closed.