gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

MAINTAINER user cant update a project

Open themaikelman opened this issue 3 years ago • 0 comments

Hello, Thank you for your work, it is wonderful to have this library.

I have a problem to update the projects (as MAINTAINER), when I want to use https://javadoc.io/doc/org.gitlab4j/gitlab4j-api/4.19.0/org/gitlab4j/api/ProjectApi.html#updateProject-org.gitlab4j.api.models.Project-

The fork, for example works, fine getProjectApi().forkProject but then if we want to update the project with getProjectApi().updateProject answer the following: org.gitlab4j.api.GitLabApiException: 403 Forbidden

Here it says that you have to add a header in the PUT (-header "PRIVATE-TOKEN: ") which could be related https://docs.gitlab.com/14.9/ee/api/projects.html#edit-project

The authentication was done with GitLabApi api = new GitLabApi(hostUrl, personalAccessToken) and with GitLabApi(hostUrl, TokenType.OAUTH2_ACCESS, authToken) but neither works.

Any clues what could be going on?

Thank you very much.

themaikelman avatar Apr 12 '22 16:04 themaikelman