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

API String Format - sessionId
 
roco
Sr. Member
 
Total Posts:  191
Joined:  2008-03-18
 

I am trying to pass a call string to a non php SOAP client and cannot figure out how to pass the session ID authentication so that it can be consumed by magento. 

I can not deduce it from the php client that is posted.  Any help would be appreciated. - roco

What is the sessionId string that Magento will accept?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Done
Jr. Member
 
Total Posts:  7
Joined:  2008-09-05
 

Hi,

so you have allready a webservice user (System->Web Services->Users) created and the call to login returns a sessionId?

 
Magento Community Magento Community
Magento Community
Magento Community
 
PandaWebStudio
Member
 
Avatar
Total Posts:  40
Joined:  2008-04-19
Amsterdam, Netherlands
 

The Magento API USERNAME and KEY are used only for communicating with Magento API. You don’t need the Magento Username and Key if you want to access another web service.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Done
Jr. Member
 
Total Posts:  7
Joined:  2008-09-05
 

Well he posted in the magento forum so for me its obvious that he want to communicate with the magento api and not with any web service

 
Magento Community Magento Community
Magento Community
Magento Community
 
PandaWebStudio
Member
 
Avatar
Total Posts:  40
Joined:  2008-04-19
Amsterdam, Netherlands
 

@Done, you’re right. I didn’t read carefully.

@roco

$stock_data=array();//some array
$proxy = new SoapClient(SERVER_URL.'api/soap/?wsdl');  
$sessionId $proxy->login(
API_USERNAME,
API_KEY
);

//session id is something like ace6fa0876ecbdf44d8463d772a88f4e
$proxy->call(
$sessionId,
 
'product_stock.update'
array(
$product_xml['PRODUCTID']$stock_data)
)

login is an operation with the following input:

<message name="login">
<
part name="username" type="xsd:string"/>
<
part name="apiKey" type="xsd:string"/>
</
message>

call is also an operation:

<message name="call">
<
part name="sessionId" type="xsd:string"/>
<
part name="resourcePath" type="xsd:string"/>
<
part name="args" type="xsd:anyType"/>
</
message>

So sessionId is a regular string parameter and you pass it just like any other parameter.

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  191
Joined:  2008-03-18
 

Thanks........I have got the sessionId to work with a program called Pentaho Data Integration (PDI).  It seems like it has a lot of potential.  Currently I have a “Data Transformation that takes the username and key and gives a sessionId. That session Id is then used in my next call to the Tier Pricing Webservice. I have got it to return just one tier pricing schema for one particular SKU, but am now wondering how to ask the webservice for all of the tier prices for all the sku’s?

Any ideas?

Thanks, Roco

 
Magento Community Magento Community
Magento Community
Magento Community
 
PandaWebStudio
Member
 
Avatar
Total Posts:  40
Joined:  2008-04-19
Amsterdam, Netherlands
 

Use catalog_product.list to get a list of all products (it returns an array) and then for each product use product_tier_price.info to get the tier prices.
http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product#catalog_product.list
http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product_attribute_tier_price

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top