Jan Kruse
Jan Kruse

Reputation: 2765

Graph API: PUT /beta/groups/<groupId>/team Authentication Error

Problem

PUT request to /beta/groups/<groupId>/team fails with the following error:

{
    "error": {
        "code": "AuthenticationError",
        "message": "Error authenticating with resource.",
        "innerError": {
            "request-id": "e4385864-85e4-4fa6-8878-458988c584e4",
            "date": "2017-11-10T10:29:39"
        }
    }
}

A Bearer token is supplied, that was generated by using delegate permissions on Group.ReadWrite.All.

The endpoint is documented here.

Things I found so far

It seems, that it's something related to teams resources. The following requests do not work:

Both fail with AuthenticationError.

Update

/beta/group/<groupId>/team does work now.

Upvotes: 5

Views: 790

Answers (2)

Ferry Koolen
Ferry Koolen

Reputation: 21

For anyone still running into this problem in 2018: Wajeed said they fixed the trailing slash token generation, which is only partially true. The trailing slash token generation works for succesfull requests but not for failing requests.

'/beta/me/joinedTeams' still returned an AuthenticationError for us. Only when we removed the trailing slash from the token generation we got a more descriptive error message telling us our test user did not have a Teams license.

Everything worked fine after granting our test user the correct license.

Upvotes: 2

Wajeed Shaikh
Wajeed Shaikh

Reputation: 3158

There was an issue when we acquire access token for graph.microsoft.com/ with trailing slash. This has been fixed and now you should be able to call /beta/group//team using token acquired by tailing slash too.

Note: Posting this as an answer so that other members need not go through all the comments.

Upvotes: 2

Related Questions