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.

Making a request to the API to add emails to OnShape team

carl_malagodicarl_malagodi Member Posts: 18 EDU
I have a excel file of email files, Is there some way that I can make an API request with all of those emails to add them to a team that I own? If this is possible would it become an issue if I tried to add an email that was already inside the team?

Comments

  • caden_armstrong2caden_armstrong2 Member, User Group Leader Posts: 127 ✭✭✭
    You can add a member to the team with api endpoint:

    /api/teams/{teamid}/members

    with the body:

    {
     "admin":false,
     "email": "john@company.com"
    }



    If you try to add a team member that is already on the team, you will just get a 409 conflict code back.
    If you try to add a team member that does not exist, that email address will get an invitation email.

  • carl_malagodicarl_malagodi Member Posts: 18 EDU
    I'm looking through the glassworks documentation and I can only find get methods for the team api endpoint, this is the site I'm looking at https://cad.onshape.com/glassworks/explorer/#/Team/, am I missing something? Also Is there an easy way to do authentication to the api through something like power automate when it seems like the docs recommend doing some more advanced crypto style authentication?

  • carl_malagodicarl_malagodi Member Posts: 18 EDU
    Ok, I've been reading more documentation on how the api works and I think the way I plan on doing this is with a custom connector in power automate that makes a request using c#(because thats the only code power automate can take and execute). If anyone has advice on how to write authenication code in c#(never written it before) or how to find a team id(is it just the team name?) or knows where the documentation around the previously mentioned endpoint(to add members is) that would be greatly appreciated, thanks.
  • caden_armstrong2caden_armstrong2 Member, User Group Leader Posts: 127 ✭✭✭
    Not every api endpoint is documented. But that comes with the caveat that the undocumented ones could change or have unexpected results.

    If you want an easy way to do authentication, you can download one of the sample apps that Onshape has created from their github. They are a great starting point. They even have one for c#.
    Or if you want to start with postman, you can check out my post in this thread, and replicate that process.

    To get the team id, browse to the page that lets you edit a team.
    The url for that page is in the form of https://cad.onshape.com/companySettings/{company id}/teams/{team id}

  • carl_malagodicarl_malagodi Member Posts: 18 EDU
    How do people know about the endpoints that don't have documentation? Is there public source code for the api that people are looking at to find stuff like that?
Sign In or Register to comment.