06-16-2017 08:42 AM
Hello there,
I don't know if I'm in the correct section for this question.
I want to create a "product" using the ELM REST API.
If I use the following request, I have an error "415 Unsupported Media Type" :
POST https://10.20.2.222/elm-resources/products
Content-Type application/json
{'name':'FBOCluster','hostInfo':'198.18.1.19','productType':'UCM','userId':'administrator','password':'C1sc0123','description':''}
But if I use the same request with a XML content, it works.
POST https://10.20.2.222/elm-resources/products
Content-Type application/xml
<product>
<name>FBOCluster</name>
<hostInfo>198.18.1.19</hostInfo>
<productType>UCM</productType>
<userId>administrator</userId>
<password>C1sc0123</password>
<description/>
</product>
Why the JSON is "unsupported" for request whereas it is used for the responses?
The ELM version is 11.5
Regards,
Fabien
06-20-2017 11:24 AM
Fabien,
I recommend you also post this to the Cisco DevNet Developer Support forum for more feedback and information.
Cisco DevNet: DevNet Developer Support
I hope this helps.
Kelli Glass
Moderator for Cisco Customer Communities
06-22-2017 07:30 AM
Hi Kelli,
Thank you for this information. I have opened a ticket on the Cisco DevNet Support (https://developer.cisco.com/dpTroubleTicket/editUser/1436).
Regards,
Fabien
06-22-2017 08:56 AM
Fabien,
Please keep in mind that the PLM API is not an officially supported interface. It was developed for some minimal internal requirements, so was never intended to be a complete development.
Have you tried using double, rather than single, quotes in your json string?
I haven't tried this, but try using:
{"name":"FBOCluster", "hostInfo":"198.18.1.19", "productType":"UCM", "userId":"administrator", "password":"C1sc0123", "description":""}
Regards,
Andy
06-27-2017 08:57 AM
Hi,
Thank you for this answer.
In fact I see that the page https://<IP>/elm-resources/application.wadl indicate that the create Product request and the update Product request does not accept JSON but only XML. In XML the request is OK for the creation but not for the modification (no error but nothing is updated)...
Regards,
Fabien
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide