ConvertAPI / convertapi-library-go

A Go library for the ConvertAPI
https://www.convertapi.com
Other
14 stars 7 forks source link

Use Bearer authentication #14

Closed tomasr78 closed 1 month ago

tomasr78 commented 2 months ago

Now token and secret are called as AuthCredentials. AuthCredentials is passed as request header field: Authorization: Bearer your_auth_credentials. Change query authentication to bearer authentication in the header.

Example

curl -X GET https://v2.convertapi.com/user -H 'Authorization: Bearer your_auth_credentials'

Replace secret and token authentication methods to one named it as AuthCredentials or pass it as a constructor argument.

tomasr78 commented 2 months ago

This is an example of how it is done in C#:

https://github.com/ConvertAPI/convertapi-dotnet/blob/44a85a9d99b5e060821622d18d3cdb7bf4d39c38/ConvertApi/ConvertApi.cs#L41