API Error 10003 - no permissions for users-post API call

Discussion in 'aMember Pro v.4' started by 2reikis, May 22, 2013.

  1. 2reikis

    2reikis aMember Pro Customer

    Joined:
    Sep 17, 2006
    Messages:
    5
    Using version 4.2.6, I've set up an API key with user permissions index, get, update, delete and create.

    From a php page, I have the code

    Code:
    <?php
        $url = 'http://example.com/amember/api/users';
        $fields = array(
                    '_key' => 'xxxxxxxxxxxxx',
                    '_format' => 'xml',
                    'login' => strtolower('mark4').time(),
                    'pass' => '1111',
                    'email' => 'tester3@example.com',
                    'name_f' => 'Mark',
                    'name_l' => 'tester',
            );
       
       
        $fields_string  = http_build_query($fields);
        //open connection
        $ch = curl_init();
       
        //set the url, number of POST vars, POST data
        curl_setopt($ch,CURLOPT_URL,$url);
        curl_setopt($ch,CURLOPT_POST,count($fields));
        curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        //execute post
        $result = curl_exec($ch);
       
        //close connection
        curl_close($ch);
        var_dump($result);
    ?>
    I'm getting "API Error 10003 - no permissions for users-post API call"

    I've checked the database and in am_api_key, the entry for this api key is {"users":{"index":1,"get":1,"update":1,"delete":1,"create":1}}

    What could the problem be?

Share This Page