Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

What is my API key? 
 
Gochos
Jr. Member
 
Total Posts:  15
Joined:  2008-07-02
 

Hi

I have someone working on an API for my dropshipping but he asked the following.

1.  We would need to find out what your API key would be or by looking at any Docs you may have been given.

The example is here:
$sessionId = $proxy->login(’apiUser’, ‘apiKey’);

We would need ‘apiUser’ and ‘apiKey’

Then we could test on our end.

Does anyone have any ideas or point me to the right direction as to were i can find taht info.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
CirTap
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-02-16
 

goto:  System > Web Services > Roles and define a Role set for your API user with the allowed actions.
For testing purposes you may create a temporary “can do everything” role first, and if things work nice, change that role to be as restrictive as necessary.
Save that Role and head over to: System > Web Services > Users
Add a new User, the username is your “api user”, the key (~ password) is the “api key”
Assign a Role in the second tab. Save.

Have fun,
CirTap

 
Magento Community Magento Community
Magento Community
Magento Community
 
junglemason
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-05-16
Portland, OR
 

Yeah, that form for creating new Web Service Users is maybe a little confusing.  I thought it was asking me for an API key that I needed to find out what it was from somewhere, but it was really just asking me to make up a key and then confirm it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dirtjunk
Jr. Member
 
Total Posts:  1
Joined:  2011-07-14
 

I know this is a really old post but it helped me out A LOT. I was in the exact same boat and this made it easy for me. Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
tarwin
Jr. Member
 
Total Posts:  2
Joined:  2012-03-01
 

Is there any way to create an API key without having to have the user add it manually?

ie OAuth2 with permissions ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
rebecacruise
Jr. Member
 
Total Posts:  5
Joined:  2012-01-12
 
tarwin - 01 March 2012 09:06 PM

Is there any way to create an API key without having to have the user add it manually?

ie OAuth2 with permissions ?

I have the same question. Any ideas?
 
Magento Community Magento Community
Magento Community
Magento Community
 
joshuabelke
Jr. Member
 
Total Posts:  4
Joined:  2011-02-02
New York
 

Oauth works with the REST another API technology (supported by magento, some additional work is required) and you have to create a Consumer App, having users create tokens. It’s faster, but better for generic tasks like Product information retrieval.

Alternatively, Programmatically, SOAP Users’s can be made:

$user Mage::getModel('api/user');
                
$userId $user->getId();

try 
{
                            $user
->setData(array(
                            
'username' =>  $soap['email'],
                            
'firstname' => $soap['firstname'],
                            
'lastname' => $soap['lastname'],
                            
'email' => $soap['email'],
                            
'api_key' => $soap['password'],
                            
'api_key_confirmation' => $soap['password'],
                            
'is_active' => 1,
                            
'user_roles' => '',
                            
'assigned_user_role' => '',
                            
'role_name' => '',
                            
'roles' => array('1')
                            ));

                            
$user->save()->load($userId);

                            
$user->setRoleIds(array('1'))
                            ->
setRoleUserId($user->getUserId())
                            ->
saveRelations();

                        
}

                        
//Continue if duplicate Email accounts found.
                        
catch(Exception $e)
                        
{

                               
echo "<pre>";
                               echo 
'Caught exception: ',  $e->getMessage(), "\n";
                               echo 
"</pre>";
                         
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top