Receiving an error when using smexportonshape()

3 次查看(过去 30 天)
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!

回答(1 个)

Shivam
Shivam 2024-1-2
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

类别

Help CenterFile Exchange 中查找有关 Foundation and Custom Domains 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by