#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,101
    Rep Power
    220

    What happens when we go over api call limits


    Hey;

    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?
    Code:
    <?php 
    // 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);
    var_dump($result);
    if(curl_errno($ch)) 
        {
            echo 'Error:' . curl_error($ch);
        }
    else 
        {
            echo "Success";
            //UPDATE OUR DB, UPDATE FIELD "PASSED_TO_OP"
        }    
    curl_close ($ch);
    
    
    
    ?>
    Last edited by English Breakfast Tea; March 28th, 2017 at 10:50 PM.
  2. #2
  3. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,278
    Rep Power
    2039
    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.
  4. #3
  5. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,034
    Rep Power
    4101
    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



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud

IMN logo majestic logo threadwatch logo seochat tools logo