Attempting to access GSX REST API, previously used the SOAP API. Just attempting to authenticate (on both the token and check endpoints) gives me a 401 Authorization required. GSX Web Support a bit slow to respond at the moment, hoping someone else had this experience and could shed some light. I am authenticating from the IP address that is whitelisted with the new certificate that was generated for me, with my GSX Administrator account.
cURL command:
curl -X POST "https://partner-connect.apple.com/gsx/api/authenticate/token" -H "X-Apple-SoldTo: ##########" -H "X-Apple-ShipTo: ##########" -H "Content-Type: application/json" -H "Accept: application/json" -H "Accept-Language: en_US" -d '{"userAppleId": "##########", "authToken": "##########"}' --cert "AppleCare-Partner-##########.Prod.apple.com.chain.pem" --key "privatekey.pem"
Full Request URL
https://partner-connect.apple.com/gsx/api/authenticate/token
Request Headers:
X-Apple-SoldTo: ##########
X-Apple-ShipTo: ##########
Content-Type: application/json
Accept: application/json
Accept-Language: en_US
Request Body:
{"userAppleId": "##########", "authToken": "##########"}
Response Headers
HTTP/1.1 401 Unauthorized
Server: Apple
Date: Fri, 06 Dec 2019 19:28:56 GMT
Content-Type: text/html
Content-Length: 188
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubdomains
X-Frame-Options: SAMEORIGIN
Response Body:
<html>
<head><title>401 Authorization Required</title></head>
<body bgcolor="white">
<center><h1>401 Authorization Required</h1></center>
<hr><center>Apple</center>
</body>
</html>