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.

API - Getting a 403: Forbidden response when trying to request a translation.

paulIkedapaulIkeda Member Posts: 2
Within our desktop application, we are requesting a translation of model from the part studio, using the following POST format:

/api/partstudios/d/<docid>/w/<workspaceid>/e/<elementid>/translations

with content

{"PartIds":null,"FormatName":"STEP","VersionString":"","StoreInDocument":false}

We are now getting a 403: Forbidden response to these requests. This response failure is a recent phenomenon - within the last few weeks it started, but has been functioning correctly for years before. No major (or even minor) changes have been made to our code that uses the OnShape API for a long time, so I'm inclined to believe that this might be an API change or an account issue. I have used the web interface and successfully downloaded translations of models - and we do appear to be getting access and secret keys correctly.

What could the reason for a 403 response be, and how do I begin to debug this problem?
Tagged:

Best Answer

  • paulIkedapaulIkeda Member Posts: 2
    Answer ✓
    With OnShape's help, I've solved the issue.

    The problem was the case of some of the parameters we were sending along with our translation request. The parameter names are case sensitive, and if you send a request missing some parameters (because they have the wrong case) and authenticate via OAuth, you get a 403 Forbidden response back (at time of writing). The API explorer is much clearer on the problem, which is how I finally caught what was going on.

Answers

  • lougallolougallo Member, Moderator, Onshape Employees, Developers Posts: 2,001
    i have pulled a ticket and will take a look. 
    Lou Gallo / PD/UX - Support - Community / Onshape, Inc.
  • paulIkedapaulIkeda Member Posts: 2
    Answer ✓
    With OnShape's help, I've solved the issue.

    The problem was the case of some of the parameters we were sending along with our translation request. The parameter names are case sensitive, and if you send a request missing some parameters (because they have the wrong case) and authenticate via OAuth, you get a 403 Forbidden response back (at time of writing). The API explorer is much clearer on the problem, which is how I finally caught what was going on.
Sign In or Register to comment.