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

create attributes, using the Magento API
 
Peter Snows
Jr. Member
 
Total Posts:  12
Joined:  2008-07-16
 

Hello ,

does anyone knw if there is an api function that I can use to create new attributes and attribute sets ?

I don’t see any in this list:
http://www.magentocommerce.com/wiki/doc/webservices-api/api

I am using Dieter code to be able to access Magento APi ( XML-RPC ) (thanks Dieter!!!)
http://www.linux4ever.be/dokuwiki/doku.php?id=magentoxtender

Another question:
Are there any plans in the future to make Magento Soap Api to work with .NET Soap Client ?
So far it just seems to work with php Soap Client, which defeats the purpose of a Soap Api.
As far I was able to understand this seems to be the problem:
http://www2.sys-con.com/itsg/virtualcd/webservices/archives/0209/seely/index.html

Thanks a lot,

Pedro

 
Magento Community Magento Community
Magento Community
Magento Community
 
MsNadia_B
Jr. Member
 
Total Posts:  2
Joined:  2008-06-10
 

I am also seeking the same functionality.
It seems the API stops short at providing only a way to list attributes and attribute sets.
I am investigating a way to do this using the server side API.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Peter Snows
Jr. Member
 
Total Posts:  12
Joined:  2008-07-16
 

The only way to achive that is by using the Dieter module XML-RPC:
http://www.linux4ever.be/dokuwiki/doku.php?id=magentoxtender

You will have to :
—use his classes in .NET and
—place some .php inside your Magento. See Dieter pointers on how to do that:

First step is to download the latest version of my MagentoXtender at http://www.linux4ever.be/dokuwiki/doku.php?id=magentoxtender

If you download the .zip file and extract ityou will find inside 2 directories
MagentoXtender 
MagentoXtender API Module

Inside the second directory 
(MagentoXtender API Moduleyou will find the Module that you need do install on your Magento websiteYust copy the /app directory over your Magento’s /app directory.

I was not able to use SOAP since, I was not able to get around the the fact that Magento sends this “Apache SOAP serialization representation of java.lang.Hashtable” .

<xsd:complexType name="Map">
<
xsd:sequence>
<
xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
<
xsd:complexType>
<
xsd:sequence>
<
xsd:element name="key" type="xsd:anyType" />
<
xsd:element name="value" type="xsd:anyType" />
</
xsd:sequence>
</
xsd:complexType>
</
xsd:element>
</
xsd:sequence>
</
xsd:complexType>
I don’t know a way of .NET Soap Client to interop with this data representation. Let me know if one exists.
This web page has same good explanation about this kind of Soap problems:
http://www2.sys-con.com/itsg/virtualcd/webservices/archives/0209/seely/index.html
I don’t think they will have a solution soon, since now if they would like to interop with the .NET Soap Client they would have to change their code and their wsdl, and all existing Soap Clients would have to change their code to conform with the new wdsl.

I started to use Dieter XML-RPC and I was able to successfully create categories (thanks Dieter !!).

But in the end I decided to create a VB class to access directly the MySQL database and insert the data directly.
Is is not pretty (if they change the database structure I will have to change my SQL code), but at least it works and in the end, I believe, it will be cleaner (less code involved).

I have not finished my .NET class , but if you need it please let me know.
Take into account that I will just code enough to get the categories, attributes and products inside the DB.
I hope to finish my code by the end of this week (this means I will be done by the end of next week).

Cheers,

Pedro

 
Magento Community Magento Community
Magento Community
Magento Community
 
JKwan13
Member
 
Total Posts:  63
Joined:  2008-06-12
 

There is a temporary solution that creates labels/options for your attributes( not the attribute or attribute sets themselves, you’ll have to create those manually).  Take a look at this thread: http://www.magentocommerce.com/boards/viewthread/9391/
Also take a look at the SQL code to alphabetize the labels, but I think since version 1.1.5, they automatically alphabetize themselves.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Peter Snows
Jr. Member
 
Total Posts:  12
Joined:  2008-07-16
 

here you have my .NET VB code:
http://duarteneveslda.googlepages.com/magento.netvb~

to create attributes, attribut sets, caegories, products.

If you have nay questions send me a private message.

Pedro

 
Magento Community Magento Community
Magento Community
Magento Community
 
NETZKOLLEKTIV
Member
 
Avatar
Total Posts:  35
Joined:  2010-05-06
Erlangen, Germany
 

Adding new attributes is possible using our NETZKOLLEKTIV Core API Extension among many more methods. You may also add newly created attributes to attribute sets and add new attribute sets.

Just take a look at our extension page and documentation. If you have any questions do not hesitate to ask using our contact form.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Borut
Jr. Member
 
Total Posts:  12
Joined:  2008-12-30
 

Hello

So there is no update on this issue? Posted solution seems like a workaround and it only works in VB .NET.

I would like to add new color to Color attribute trough API, since it\\\’s hard to prefill all the possible colors in advance.

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