A Quickstart Guide with the SOLIDWORKS PDM Web API

Amen Jlili

Headups:

  • This post is not about the PDM Web2 viewer.
  • This feature is not available with SOLIDWORKS PDM Standard.



This year, 2022, SOLIDWORKS Corp. quietly released documentation for its PDM Web API. This feature of PDM Professional installs an IIS web application (Web API) that exposes some elements of your vault to the web. Any web application can now access your PDM vault provided IIS and your firewall are configured correctly.

This feature is as usual only available with PDM Professional.

At first glance, the documentation is quiet dry, if not unreadable.

After a couple backs and forths with API support, SOLIDWORKS confirmed that the docs were auto-generated and that they plan on creating proper documentation in the future.

The API support team was kind enough to go through some of the most usual endpoints and showcase how to make the proper calls.

In this article, I’d like to go over the authentication endpoint and the file information endpoint. Before we do that, you need to install the web API component.

Once you have the web API installed, you need to make sure the following settings are set:

  • Add a firewall rule to allow communication via the 65453 port.
  • Edit the basic settings of the web application in IIS and enable the authorization for the Windows user profile that is running the application:

Once you have done those two things, you can use postman to hit authentication endpoint like follow:

  • Request is of type POST
  • Url: http://server:65453/api/VaultName/authenticate
  • Headers: Add a Content-Type with a parameter of application/json
  • Finally, a raw body with the following value:


    {“Password”:”this is my super hard admin password”,”Username”:”admin”}



Your response will look like this:


You will need to use the JwtString (Access token) in subsequent calls. In postman, just make sure you add the JwString as a bear token. This can be done from the Authorization tab.

Unfortunately, there is no way to determine when the access token expires. It seems that at this version of PDM Web API, you need to consume the token until you get an unauthorized exception. API support indicated they are aware of this and will probably include this as an improvement in the future.

What’s next ?

  • If you are interested in connecting PDM with your web application, please reach out to us. We’d love to help you understand the PDM Web API Json object model.
  • Our PDM Web API client can save a lot of time. Contact us for sales information.

More great articles

Learn how to write SOLIDWORKS PDM add-ins with PDMFramework

https://www.youtube.com/watch?v=n5gaSZPqsbg&t=1s In which Amen demos the PDMFramework library The PDMFramework library opens up a world of new possibilities for programmers…

Read Story

Auto-update SOLIDWORKS PDM add-ins

The auto-updater add-in is a tool developed by Blue Byte Systems, Inc. to streamline our code delivery process for our…

Read Story

Must-know EPDM API errors for SOLIDWORKS add ins

PDM administration tool Below is a compiled list of the most notoriously common errors that you may encounter while deploying…

Read Story
Arrow-up
×