• Resolved mdm

    (@meggsp)


    I use Unleashed to keep stock levels of Woocommerce, so WPGetAPI needs to connect to Unleashed. The Unleashed API doc states:

    Each request to the API must include these four values sent as HTTP headers:

    • Content-Type – This must be either application/xml or application/json.
    • Accept – This must be either application/xml or application/json.
    • api-auth-id – You must send your API id in this header.
    • api-auth-signature – You must send the method signature in this header.
    • client-type – You must send your client-type in this header to enable tracking. The value must follow the convention partner_name/app_name or partner_name. i.e. acme/acmeEDI or acme.

    I keep getting this error, when trying to connect to Unleashed API

    {“message”:”Authorization has been denied for this request”}

    Unique ID – Products

    Endpoint – /products

    Method – GET

    Results format: JSON String

    Headers:

    Content-Type – application/json
    Accept – application/json
    api_id – ******

    api_key – *****

    www-authenticate – Bearer *******

    Full error report:
    Array ( [headers] => Requests_Utility_CaseInsensitiveDictionary Object ( [data:protected] => Array ( [date] => Mon, 13 Feb 2023 15:48:31 GMT [content-type] => application/json; charset=utf-8 [cache-control] => private [server] => Microsoft-IIS/10.0 [x-aspnet-version] => 4.0.30319 [www-authenticate] => Bearer [x-powered-by] => ASP.NET ) ) [body] => {“message”:”Authorization has been denied for this request”} [response] => Array ( [code] => 401 [message] => Unauthorized ) [cookies] => Array ( ) [filename] => [http_response] => WP_HTTP_Requests_Response Object ( [response:protected] => Requests_Response Object ( [body] => {"message":"Authorization has been denied for this request"} [raw] => HTTP/1.1 401 Unauthorized Date: Mon, 13 Feb 2023 15:48:31 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: close Cache-Control: private Server: Microsoft-IIS/10.0 X-AspNet-Version: 4.0.30319 WWW-Authenticate: Bearer X-Powered-By: ASP.NET {"message":"Authorization has been denied for this request"} [headers] => Requests_Response_Headers Object ( [data:protected] => Array ( [date] => Array ( [0] => Mon, 13 Feb 2023 15:48:31 GMT ) [content-type] => Array ( [0] => application/json; charset=utf-8 ) [cache-control] => Array ( [0] => private ) [server] => Array ( [0] => Microsoft-IIS/10.0 ) [x-aspnet-version] => Array ( [0] => 4.0.30319 ) [www-authenticate] => Array ( [0] => Bearer ) [x-powered-by] => Array ( [0] => ASP.NET ) ) ) [status_code] => 401 [protocol_version] => 1.1 [success] => [redirects] => 0 [url] => https://api.unleashedsoftware.com/products [history] => Array ( ) [cookies] => Requests_Cookie_Jar Object ( [cookies:protected] => Array ( ) ) ) [filename:protected] => [data] => [headers] => [status] => ) )

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Connecting WPGetAPI to Unleashed’ is closed to new replies.