# How to invoke REST API using basic authentication?
Using cURL:
To invoke the REST API with basic authentication using cURL, simply append the --user flag followed by your username and password to the cURL command,
--user "username:password"
1
Example:
curl -X POST -T @./my-heap-dump.zip "http://localhost:8080/analyze-hd-api?apiKey={YOUR_API_KEY}" --header "Content-Type:text" --header "Content-Encoding:zip" --user "ycUser:ycPassword"
1
Using Postman:
To pass credentials and invoke the REST API with Postman, follow these steps:
- Open Postman.
- Go to the 'Authorization' tab.
- Select 'Basic Auth' type from the dropdown menu.
- You will see two textboxes on the right side of the screen.
- Enter your username and password that you have configured when enabling basic authentication. In the example below, we have configured 'ycrash' as both the username and password.
# Related documentation
- REST API Authentication — Overview of all authentication methods
- LDAP Token Authentication
- API Key Authentication