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.

Options

I am new to Onshape, can someone guide me on how to setup webhooks?

Yatiraj_ChakreYatiraj_Chakre Member Posts: 6
We are integrating Onshape and Propel using Jitterbit(its a middleware like mulesoft). Our requirement is when a document is changed, we want the drawing json data to be sent to API endpoint which is exposed by Jitterbit, then Jitterbit updates this data in Propel. It looks that a webhook can send data to an endpoint but its not clear on how to setup webhooks in ohshape.

Answers

  • Options
    Caden_Armstrong_Caden_Armstrong_ Member Posts: 27 PRO
    Have you read the documentation for webhooks?
    https://onshape-public.github.io/docs/app-dev/webhook/

    First step is to register a webhook:
    https://cad.onshape.com/glassworks/explorer/#/Webhook/createWebhook


    www.smartbenchsoftware.com
    Custom FeatureScript and Onshape Integrated Applications
  • Options
    Yatiraj_ChakreYatiraj_Chakre Member Posts: 6
    Thanks Caden, I am able to create a webhook, but landed on another issue. I am sending "events","companyid","documentid" & "elementid" in creating webhook request but in response its not returning "documentid" so I am thinking its not properly registered.(even though it comes back as 200 and webhookid) I am using "onshape.comment.create" event and I am not getting comment added notifications. Wondering what I am missing.
    Create webhook Request -
    {
        "companyId": "dummyvalue",
        "description": "dummyvalue",
        "documentId": "dummyvalue",
        "elementId": "dummyvalue",
        "events": [
            "onshape.comment.create"
        ],
        "url": "dummyvalue"
    }
    Create webhook Response -
    {
        "filter": null,
        "data": null,
        "description": "dummyvalue",
        "options": {
            "collapseEvents": true
        },
        "url": "dummyvalue",
        "companyId": "dummyvalue",
        "createdBy": {
    user details
        },
        "projectId": null,
        "folderId": null,
        "events": [
            "onshape.comment.create"
        ],
        "isTransient": false,
        "externalSessionId": null,
        "droppedEventCount": 0,
        "name": null,
        "id": "dummyvalue",
    }
    Onshape validation call (does not show documentid)-
    {
    "jsonType" : "lifecycle",
    "event" : "webhook.register",
    "messageId" : "dummyvalue",
    "timestamp" : "dummyvalue",
    "webhookId" : "dummyvalue"
    }

  • Options
    Caden_Armstrong_Caden_Armstrong_ Member Posts: 27 PRO
    Might be worth trying with workspaceId or versionId added.

    www.smartbenchsoftware.com
    Custom FeatureScript and Onshape Integrated Applications
  • Options
    Yatiraj_ChakreYatiraj_Chakre Member Posts: 6
    Yes, tried but same result. I am also sending a 200 satus when onshape tests the URL I gave. There doesnt seem a good way of checking if webhook is successfully registered or not, the documentation says that if you can ping to a webhook then it is registered but I dont get any notifications.
  • Options
    Urs_Egger_REACTUrs_Egger_REACT Member Posts: 59 PRO
    Isn't there an onshape/propel integration available already?

  • Options
    Yatiraj_ChakreYatiraj_Chakre Member Posts: 6
    Zapier is there but we want to use Jitterbit which is our middleware for all integrations
Sign In or Register to comment.