Events

request: function(method, url, headers, body) - emitted when a request has been sent to Sendwithus

response: function(statusCode, body, response) - emitted when a response has been received back from Sendwithus

Run Tests

Install requirements

npm install

Run Unit Tests

npm test

Troubleshooting

General Troubleshooting

Enable debug mode

Make sure you're using the latest Node client

Capture the response data and check your logs — often this will have the exact error

Enable Debug Mode

Debug mode prints out the underlying request information as well as the data payload that gets sent to Sendwithus. You will most likely find this information in your logs. To enable it, simply put debug=true as a parameter when instantiating the API object. Use the debug mode to compare the data payload getting sent to Sendwithus' API docs.

var api =require('sendwithus')('API_KEY', debug=true);

Response Ranges

Sendwithus' API typically sends responses back in these ranges:

2xx – Successful Request

4xx – Failed Request (Client error)

5xx – Failed Request (Server error)

If you're receiving an error in the 400 response range follow these steps: