GITEA API say always that I am unauthorized

Hello,
i have the problem that only a few of of the Endpoints in the Gitea API are working.

What I want is to create a Pull Request over the API!

When I authorize via basic authorization, then endpoints like ‘GET /orgs’ or ‘GET /repos/{owner}/{repo}/pulls’ are working fine! But when I want to use endpoints for example like
‘GET /notifications’ I get this
Bildschirmfoto 2020-03-18 um 19.12.35
i am definitiv not unauthorized…, I am logged in as administrator.

I need an example for how to create a pull request over the Gitea Api with curl ? I don’t understand how to create the pull request to say something like I want to have the master as the destination and want to pull from the feature … how can I do this?

Hello and welcome!

You should probably use a token to access the API, as some things may not work with basic auth as far as I remember.

That being said, what you want is the create PR endpoint
Where base would be master and head would be feature/my-feature or user:feature/my-feature if in a fork.

1 Like

Hello jolheiser,

thank you for your response!
Thats weird but it’s like you say… I tested these before with AuthorizationHeaderToken and it’s not working…, it’s only worked when you set the same Token to ‘access_token’ or to ‘token’ than it work …

Thank you the PullRequest is now working…!

Have a nice day and stay healthy…

1 Like