The Query Service API uses HTTP Basic to authenticate requests. When you send a request, you must include the authorization type and value in the Authorization header.
If you are a VantageCloud Enterprise user, contact Teradata Support to set up Query Service.
The Authorization header is constructed as follows:
- The username and password are combined into a string ("username:password").
- The resulting string is encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line.
- The authorization method and a space ("Basic ") is added to the encoded string.The resulting value is Basic [Base64 encoded "username:password"].
curl --insecure -X POST \
"$HOST:1443/systems/prod/queries" \
-H 'Accept: application/vnd.com.teradata.rest-v1.0+json, */*; q=0.01' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic ZGJjOmRiYw==' \
-d '{"query": "SELECT * FROM dbc.dbcinfo", "format": "csv", "include_columns": true}'