March 28th, 2017, 10:29 PM
What happens when we go over api call limits
Using Ontraport. They allow 180 api calls per minute.
1 - What happens when we go over 180? Calls get lost in cyberspace or get flushed slowly, slowly?
2 - Also what is OP's response in case it's a failed attempt (For any reason. Either over 180 calls, or anything else)
3 - If the code below shows "success", does it mean the data has been passed to OP successfully and there hasn't been any errors (over 180 and any other type of error). In other words, have I placed "PASSED_TO_O" inthe right spot?
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.ontraport.com/1/Contacts");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "firstname=Some%20name&f1458=24&email=eb2denww_test%40gmail.com");
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers = "Content-Type: application/x-www-form-urlencoded";
$headers = "Accept: application/json";
$headers = "Api-Key: *******";
$headers = "Api-Appid: *******";";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo 'Error:' . curl_error($ch);
//UPDATE OUR DB, UPDATE FIELD "PASSED_TO_OP"
Last edited by English Breakfast Tea; March 28th, 2017 at 10:50 PM.
March 29th, 2017, 01:27 AM
1 - No idea. Seeing as how it's a commercial API system, why don't you ask the people that actually run it. You know, they normally have a better idea of how their own system works then people on here will (unless they actually work for that company).
2 - See above... Same deal.
3 - It all depends on the result that's returned to your system. Just saying "no CURL failure, so it's all good" is very very wrong - at least in a decent API system. They will have actual error messages, codes, etc set up. Find them and use them.
March 29th, 2017, 01:35 AM
Those are all question you need to direct to Ontraport, either via their support or by reading their API documentation to see if it says anything.
1) You'd probably get an error code in response (eg, 429 Too many requests) and the API call would fail.
2) If the call fails you'd likely get some kind of an error code. Read the documentation to find out what specifically. They might try and return a meaningful HTTP code if the reason for the failure permits, or something generic with details in the response otherwise.
3) If the API returns a successful response then everything should be good. Again this is something that you simply need to read the documentation to find out for sure. It's theoretically possible that a successful api call requires you to to check for more than just a successful HTTP response code.
Recycle your old CD's, don't just trash them
If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud