How do I use my API Token to Trigger a Pipeline?

I went through this guide and created a API Token that gets triggered, but the guide didn’t mention how I trigger a Pipeline with the API Token. I tried something like this in my pipeline script:

pipeline 
{
	triggers {
            GenericTrigger(
                causeString: "//Lyra/Main stream has been updated",
                token: "1h32h255941e654eej454kj34453y2"
        )
    }
...

I found online an example with GenericTrigger but I get this error:

WorkflowScript: 13: Invalid trigger type “GenericTrigger”. Valid trigger types: [upstream, cron, githubBranches, githubPullRequests, githubPush, p4Trigger, pollSCM] @ line 13, column 9.
GenericTrigger(
^

It mentioned “p4Trigger” but I couldn’t find anything online on how to use it. I feel like I’m misunderstanding how this works. Can someone enlighten me, please? :pray:

I assume you created a personal API token. This API token is used like your password, e.g. when using curl you use
curl -u 'user:token' <url>
instead of
curl -u 'user:password' <url>
There is no need to define anything in the pipeline itself. It is even bad to put this token in the pipeline code as anyone that has access to it can now login to your Jenkins with your username.

The GenericTrigger you used requires the plugin Generic Webhook Trigger to be installed which then allows you to trigger jobs without using a personal API token.