1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do you set up a reseller api?

Discussion in 'General Scripting Chat' started by Tyman, Jun 15, 2015.

  1. Tyman

    Tyman Newbie

    Joined:
    Jun 9, 2014
    Messages:
    16
    Likes Received:
    1
    Home Page:
    So I'm reselling instagram followers and likes on my site and the reseller panel I use offers an API but it doesn't give all the instructions I need to install it on my site.

    All it says is: For add a new order you should perform a HTTP Call to the following url with the following parameters

    I tried googling http call but I'm not really finding much. Anyone have a link to a tutorial or anything? It is for a wordpress site using woocommerce if that helps.
     
  2. bluehatface

    bluehatface Regular Member

    Joined:
    Oct 19, 2013
    Messages:
    258
    Likes Received:
    104
    Location:
    Here
    Depends on the API, but look at PHP CURL. You either set parameters in the URL (i.e. xxxx.php?var1=something&var2=somethingelse), or as POST fields, depending on the API. Then bundle it as a WP plugin.

    TBH, if you're asking how to do a HTTP call, you probably need to hire someone.
     
    • Thanks Thanks x 1
  3. Tyman

    Tyman Newbie

    Joined:
    Jun 9, 2014
    Messages:
    16
    Likes Received:
    1
    Home Page:

    Thanks, I just started learning stuff about wordpress last week and have been googling every problem I've come across and learned how to do everything I've needed so far.

    The api is set up like this: api.php?key={your_private_key}&action=add&type={service_type}&amount={amount_actions}&link={link_to_delivery}

    I'm guessing it gets sent after the checkout is complete, I'll look into PHP CURL now, does that allow me to add stuff after a certain action is complete?
     
  4. BlueWaterLover

    BlueWaterLover Junior Member

    Joined:
    Feb 28, 2015
    Messages:
    186
    Likes Received:
    159
    Location:
    Localhost
    It will be hard for you to do if you just learned wordpress. I have been coding for years before I knew php to do this stuff. You may can hire someone from freelancer.com they are good and they are cheap
     
    • Thanks Thanks x 1
  5. Tyman

    Tyman Newbie

    Joined:
    Jun 9, 2014
    Messages:
    16
    Likes Received:
    1
    Home Page:

    Alright, I'll post a job and hopefully learn how they do it by looking at it once it is complete. Thanks for your help
     
  6. bluehatface

    bluehatface Regular Member

    Joined:
    Oct 19, 2013
    Messages:
    258
    Likes Received:
    104
    Location:
    Here
    With PHP CURL, you give it an URL, and execute, so your PHP code might be something like...

    Code:
    <?php         // create curl resource 
            $ch = curl_init(); 
    
    
            // set url 
            curl_setopt($ch, CURLOPT_URL, "api.php?key={your_private_key}&action=add&type={service_type}&amount={amount_actions}&link={link_to_ delivery}"); 
    
    
            //return the transfer as a string 
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    
    
            // $output contains the output string 
            $output = curl_exec($ch); 
    
    
            // close curl resource to free up system resources 
            curl_close($ch);      
    ?>
    but with your own variables in there.

    I would presume you deal with checkout yourself i.e. you have a form on your website, take payment off the customer, and then if payment is successful, you call the api.php URL with the data.

    All CURL does is send the data to the API, and return a response. You would have to implement all the actions yourself.

    Good luck!
     
    • Thanks Thanks x 1
  7. Tyman

    Tyman Newbie

    Joined:
    Jun 9, 2014
    Messages:
    16
    Likes Received:
    1
    Home Page:
    Hired someone from elance last night and got everything finished this morning. I looked at the code and I'm glad I just got someone to do it because it looks like it would have taken me forever to learn how to do everything.

    Thanks for the help
     
    • Thanks Thanks x 1