Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
How to use webhooks for translations
Michał_Wójcik
Member Posts: 13 ✭
I'm using webhooks to check if a model has changed and then create a translation of the model each time it changes. I registered a webhook with 2 events: "onshape.model.lifecycle.changed" and "onshape.model.translation.complete". I get a notification on change, but when I create a translation, I never get the "complete" notification. When I check the translation by its ID manually, it's done and I can download it. I also tried registering a seperate webhook for translations, with the same document, workspace and element IDs, it still won't work. What should I do to get a notification? Or is it just broken and should be removed from documentation?
1
Answers
www.virtualmold.com
You should be getting a notification upon completion - I think your understanding is correct. Can you include the exact request body you sent upon registering for the webhook?
"events": ["onshape.model.lifecycle.changed","onshape.model.translation.complete"],
"filter": "{$DocumentId} = '52c526d69a766eb4364973d3' && {$WorkspaceId} = '38cbdf8c8ebe22f18f17fc6a' && {$ElementId} = 'a3237df3ce503e27df514451'",
"options": { "collapsibleEvents": "true" },
"url": <my publicly visible dev server domain name>,
"documentId": "52c526d69a766eb4364973d3"
}
Again, it works fine for the "onshape.model.lifecycle.changed" event.
We do not have any info on model translation completion for now
Its been a while since Ive looked at the code I had so I dont remember the specifics. Let me try to find it and see if had commented it around some of the issues I saw in it.