HTTP Basic: Access denied

thedevilz's Avatar

thedevilz

05 Oct, 2011 09:26 PM

hello,

this is the first time I am trying to use this api, I am trying to use by php curl.
but I am getting results "HTTP Basic: Access denied"

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER,array('Authorization: Basic ,'. base64_encode($token),'Accept:application/xml','Content-Type: application/xml' ) );

        $result  = curl_exec($ch);

        $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

help please
Regards
Ralph

  1. Support Staff 1 Posted by Jessie on 06 Oct, 2011 06:18 AM

    Jessie's Avatar

    Access denied means that you did not enter correct credential. Please look at this example, you might want to explore using curl first.

    Use example below, just replace api key with your own

    curl -u 4acc660ce98b9d38d7fea10705aa1ebd7d836fe0:X \
    -H "Accept: application/xml" \
    -H "Content-Type: application/xml" \
    "https://test_account.imonggo.com/api/products.xml"
    

    More information can be found here:

    http://support.imonggo.com/help/kb/api/product-api

  2. Peter closed this discussion on 16 Oct, 2011 04:18 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac