If you're using OAuth, you can't use curl. The use of OAuth tokens requires that you utilize a programming library in a language such as Java, perl, python, nodejs, etc in order to make these calls. There are tokens that can be created, but these are OAuth tokens. Jira Server does not have the same kind of API tokens that can be created for Atlassian Cloud products. There are different kinds of tokens to refer to below. Platforms here refers to the difference between Server and Atlassian Cloud products.
There are different methods for authenticating to the REST API in regards to Jira, but each platform has some slightly different authentication methods available to them and as such have different use cases. I wanted to add a more comprehensive and clarifying answer here, sorry if it's long-winded: As a result, I think that some people searching google that come across this issue find the answer confusing or misleading for their own use cases. Moses' reply does provide ways to use OAuth to authenticate via REST, but this method does not utilize curl (and I can't find a way to use curl with OAuth).
Saranya is asking about how to use a different authentication method other than Basic with curl. Having reviewed this question, it appears that the question asked and the answer given don't exactly match up here.