Receiving an error when using smexportonshape()

4 Ansichten (letzte 30 Tage)
Elesey Razumovskiy
Elesey Razumovskiy am 20 Jan. 2022
Beantwortet: Shivam am 2 Jan. 2024
I'm getting this error when using smexportonshape('URL'):
Error using smexportonshape_implementation
The server returned the status 403 with message "Forbidden" in response to the request to URL
https://cad.onshape.com/api/documents/d/047de99251bde16077b76a54/externaldata/61e8f2ac20a81e220f284256.
Error in smexportonshape_implementation
Error in smexportonshape_implementation
Error in smexportonshape_implementation
Error in smexportonshape_implementation
Error in smexportonshape (line 38)
xmlFileName = smexportonshape_implementation(url, varargin{:});
following the link gives this message:
"{"message":"Unauthenticated API request", "status":401}"
Any help is appreciated!
  2 Kommentare
mouad boumediene
mouad boumediene am 26 Mai 2022
i have the same problem, did you solve it yet ?
Tobias Wolf
Tobias Wolf am 27 Jun. 2022
Same problem here

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shivam
Shivam am 2 Jan. 2024
Hi,
Based on your shared details, I understand that when attempting to use the 'smexportonshape' function with the given URL, the server responds with a 403 status code, indicating "forbidden." Additionally, when you try to access the URL directly through a web browser, you encounter a 401 status code with the message stating an "Unauthenticated API request."
It's important to recognize that a 403 Forbidden status code means that the server understands your request but is declining to fulfill it. This usually happens if the user lacks the necessary permissions for the resource.
According to the documentation, you must initially grant Simscape Multibody Link access to your Onshape account when using the 'smexportonshape' function for the first time. Doing so allows the Onshape platform to provide the function with access through Javascript tokens, which secure your login details.
Please refer to the following documentation to know more about the 'smexportonshape' function and its use: https://in.mathworks.com/help/releases/R2023b/sm/ref/smexportonshape.html
I hope it helps.
Thanks

Kategorien

Mehr zu Foundation and Custom Domains finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by