cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
4374
Views
1
Helpful
4
Replies
fabien.bonic
Contributor

ELM REST API - create a "product" in json

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

4 REPLIES 4
keglass
Rising star

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

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

Andrew Hickman
Cisco Employee

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

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

Create
Recognize Your Peers
Content for Community-Ad