i've made successful authentication with the following python script to a REST API:
import requests, base64
import json
VendorId = "a"
VendorPassword = "b"
UserId = "c"
UserPassword = "d"
PropertyId = "e"
authurl = "https://url/api/auth"
usrPass = '' + VendorId + ":" + VendorPassword
b64Val = base64.b64encode(usrPass)
payload = { "UserId" : UserId, "UserPassword" : UserPassword, "PropertyId" : PropertyId}
r = requests.post(authurl, headers = {"Authorization":b64Val}, data = payload)
and i want to do it through curl (completely inexperienced). What i've figured out until now is the following:
curl -H "{'Authorization': 'abCdEfgHijKlmnop=='}" -X POST -v "https://url/api/auth" -d "batch={'PropertyId': 'e', 'UserId': 'c', 'UserPassword': 'd'}";
but i get the following 502 error from the REST API...
If i don't use a header i have the following error:
< X-SERVICENAME-Auth-Error: Missing vendor credentials in HTTP auth header
I just want an insight on what i'm missing here, does the header syntax is wrong, or maybe the curl arguments misplaced?
Thanks in advance for any idea/tutorial/advice!