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 rollbackBarIndex functionality

kevin_coulsonkevin_coulson Member Posts: 2 ✭✭

Hi,

I'm trying to output the feature tree from a part studio via python - specifically via onshape-client.client.Client.api_client.request(…) (here)

With a standard request, I can output the appropriate response json via the link:

https://cad.onshape.com/api/partstudios/d/34194a7792ea9db6d10188d3/w/2603dadfb9d5ccf8117390d0/e/140112c65afa2d3dddb074ba/features

However, when I include extra parameters (rollbackBarIndex, noSketchGeometry, etc), I can see the response via the link:

https://cad.onshape.com/api/partstudios/d/34194a7792ea9db6d10188d3/w/2603dadfb9d5ccf8117390d0/e/140112c65afa2d3dddb074ba/features?rollbackBarIndex=2&noSketchGeometry=false

but there are 2 problems:

  1. the Client.api_client.request runs into a 403 "Resource does not exist, or you do not have permission to access it." This is confusing since I seemingly have access based on the successful response of my initial request. As for my arguments, method='GET', url=the above url, query_params={}, headers={the usual stuff}…
  2. the 'rollbackIndex' is defined as '4' in the response (the end of the feature tree) rather than the '2' that I specified. This problem also exists when executing via the glassworks REST API Explorer, indicating that this parameter is ignored:
image.png

So what's happening here? Why are these requests being forbidden by the API? Why isn't the rollbackBarIndex being acknowledged? Any help is appreciated!

Answers

  • Caden_ArmstrongCaden_Armstrong Member Posts: 261 PRO

    I just tried, and while I am not seeing a 403, I also see that the rollback bar index parameter doesn't seem to do anything.

    What do you need the rollback index for? The definitions of the features shouldn't change when the rollback index is changed.
    I know that the rollback index works for other endpoints (such as evaluate featurescript)

    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
Sign In or Register to comment.