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 Explorer Authentication Trouble

Hi All,

I'm new to both OnShape and the Developer Portal and I'm having some difficulty testing REST calls using the API Explorer app. I am getting a 401 response every time I try to run a REST call with any type of OAuth requirement.

So far I have tried creating an API Key through the developer portal with all the OAuth permissions that I would need. I used that API Key to attempt a call and I get the 401 regardless of which call I test (using the "Try me" feature). Do I need to create an OAuth Application in the developer portal to be able to use this? Am I able to use the API Explorer as a standalone testing tool? If I need to connect the API Explorer using the OAuth Application tool in the developer portal, what do I need for the OAuth and Redirect URLs? Any pointers would be helpful.

Thanks!

Comments

  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    Yes, you need these access key & secret key-




    You need to get API explorer to work before moving on. I still use it to see how an API works and look at what it returns. 

    There's a lot of requirements needed to get a response and the API explorer is the best tool to complete the operation.

    Once you get it working, then you can begin your oauth.

    Oauth is used when you write an app for someone else's account. In this, they have to give you permission.

    There's another authentication to access your account which isn't as difficult. There's a github example showing how to use it.

    Steps to API:
    1 get API explorer working
    2 get logging into your account working (github examples)
    3 lastly oauth, rule the domains of others

     
  • zachary_hudson791zachary_hudson791 Member Posts: 3
    So I have created an API Key with both the access key and the secret key, but I get the unauthorized response when I try to run an API that has an "OAuth" tag on it. For example, in API Explorer, I can run the "Get Translation Formats" call and get a response without error, but if I run any with an "OAuth" tag I get a "Unauthenticated API request" response. Is there a different set of requirements necessary for the "OAuth" API calls? I have checked all the necessary permissions within the API Key.
Sign In or Register to comment.