I have created a custom trigger form my project in GitLab and it works fine on branch 'main' via curl (with POST queries):
curl -X POST -F token=%myToken% -F ref=main https://%mygitlab%/api/v4/projects/82/trigger/pipeline
OR:
curl --request POST "https://%mygitlab%/api/v4/projects/82/trigger/pipeline?token=%myToken%&ref=main"
But I want to use webhook and try the next:
https://%mygitlab%/api/v4/projects/82/ref/main/trigger/pipeline?token=%myToken%
It doesn't work and returns 404:
{"error":"404 Not Found"}
What do I miss or do wrong? May be I must to configure something?
It cannot find it because your repository is not public. You have to add the
tokenparameter to login into your account so it is able to see your repo and succesfully trigger the pipeline.The
tokenparameter must contain an accessToken you generate in your personal gitlab account. Make sure you gave enough permission to the accessToken.Also, instead of passing the ref in the url try: