22.10.2020, 11:24
You must provide "Content-Length" header for POST requests. Move your GET variables to POST payload:
Code:
url = apiHost..endpointToken
payload = encodepost({
code = authCode,
grant_type = 'authorization_code',
client_id = 'customer_api',
redirect_uri = uri,
})