Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:

  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Is there an example of a Request Body for the Update Element Metadata API method?

I am refactoring some of our code to remove the deprecated Elements methods with the new MetaData methods and I'm having trouble figuring out the format of the JSON for the Request Body.  The API Explorer has the following definition but it's not clear to me how to set these JSON Values.  I've been able to successfully Get the Element Metadata, just not Update it using the new method(s).
Request Body Template for Update Element Metadata (/metadata/d/:did/[wv]/:wv/e/:eid)
{
  "items": "Object[]",
  "items.0": "Object",
  "items.0.href": "String",
  "items.0.properties": "Object[]",
  "items.0.properties.0": "Object",
  "items.0.properties.0.propertyId": "String",
  "items.0.properties.0.value": "Object"
}

Thanks in advance for any help and/or sample code.
-Gary

Best Answers

  • gary_clough057gary_clough057 Posts: 7
    Accepted Answer
    Hi @mthiesmeyer,

    Thanks for the quick reply and working like a dream.   Makes it much easier to get/set Custom properties now...

    Thanks again,
    -Gary

Answers

  • gary_clough057gary_clough057 Member Posts: 7
    Accepted Answer
    Hi @mthiesmeyer,

    Thanks for the quick reply and working like a dream.   Makes it much easier to get/set Custom properties now...

    Thanks again,
    -Gary
Sign In or Register to comment.