HTTP request using BasicOAuth2 with ''grant_type'' = ''api_key''

Hi, I'm basically using a basic authentication with my username & password to retrieve an access token which is for some reasons not working anymore.
Can you please help me do the same using a BasicOAuth2 with ''grant_type'' = ''api_key''. I have the corresponded API key, I just don't know how to write it, should I do it via the same HTTP block or use a function ?
With thanks.

There is no such thing as 'BasicOAuth2' - it is either Basic or OAuth2. If it is OAuth2, it is not very simple unfortunately.