Strange XAPI error fetching a recording

Paul-2024

Customer
Joined
Feb 16, 2024
Messages
48
Reaction score
12
Hi everyone, today I noticed a strange issue that seems to happen with a few rare calls, even though the recording is accessible via the 3CX hosting control panel I'm having an issue accessing that recording via the API.

Normal I would query:
The response:
RESPONSE OK:
RIFF&

But there is a call that this method always fails:
The response:
{"error":{"code":"400","message":"WARNINGS.XAPI.FILE_NOT_ACCESSIBLE"}}

I'm able to grab the recording for much older calls, this one is from 07/11/2024.
How can I further troubleshoot this?

Thank you
 
Hi @Paul-2024
Can you download this recording via the Admin console or do you get an error there as well?
 
Hi @Paul-2024
Can you download this recording via the Admin console or do you get an error there as well?
Hi Andreas, correct I'm able to download it via the admin console, which in fact after checking out the developer console in the browser does the very same request I'm doing from my app

Code:
https://domain.3cx.us/xapi/v1/Recordings/Pbx.DownloadRecording(recId=28901)?access_token=eyJhbGciOiJFUzI1NiIs....CiFLTIFg

The only difference being the token of course:

Code:
https://domain.3cx.us/xapi/v1/Recordings/Pbx.DownloadRecording(recId=28901)?access_token=eyJhbGciOiJFUzI1NiIs....GiKMH8hA
 
Last edited:
Very strange, how come it fails on this call only...

JSON:
{
  "Request": {
    "AlwaysMultipartFormData": false,
    "MultipartFormQuoteParameters": false,
    "MultipartFormQuoteBoundary": true,
    "FormBoundary": null,
    "Parameters": [],
    "CookieContainer": {
      "Capacity": 300,
      "Count": 0,
      "MaxCookieSize": 4096,
      "PerDomainCapacity": 20
    },
    "Authenticator": null,
    "Files": [],
    "Method": 0,
    "Timeout": 0,
    "Resource": "/xapi/v1/Recordings/Pbx.DownloadRecording(recId=28901)?access_token=eyJhbGciOiJFUzI1NiIs....GiKMH8hA",
    "RequestFormat": 0,
    "RootElement": null,
    "OnBeforeDeserialization": null,
    "OnBeforeRequest": null,
    "OnAfterRequest": null,
    "Attempts": 1,
    "CompletionOption": 0,
    "CachePolicy": null,
    "ResponseWriter": null,
    "AdvancedResponseWriter": null
  },
  "ContentType": "application/json",
  "ContentLength": 70,
  "ContentEncoding": [],
  "Content": "{\"error\":{\"code\":\"400\",\"message\":\"WARNINGS.XAPI.FILE_NOT_ACCESSIBLE\"}}",
  "StatusCode": 400,
  "IsSuccessStatusCode": false,
  "IsSuccessful": false,
  "StatusDescription": "Bad Request",
  "RawBytes": "eyJlcnJvciI6eyJjb2RlI.......T1RfQUNDRVNTSUJMRSJ9fQ==",
  "ResponseUri": "https://domain.3cx.us/xapi/v1/Recordings/Pbx.DownloadRecording(recId=28901)?access_token=eyJhbGciOiJFUzI1NiIs....GiKMH8hA",
  "Server": "nginx",
  "Cookies": [],
  "Headers": [
    {
      "Name": "Connection",
      "Value": "keep-alive",
      "Type": 2,
      "Encode": false,
      "ContentType": {
        "Value": "text/plain",
        "AsMediaTypeHeaderValue": {
          "CharSet": null,
          "Parameters": [],
          "MediaType": "text/plain"
        }
      }
    },
    {
      "Name": "X-3CX-Version",
      "Value": "20.0.5.551",
      "Type": 2,
      "Encode": false,
      "ContentType": {
        "Value": "text/plain",
        "AsMediaTypeHeaderValue": {
          "CharSet": null,
          "Parameters": [],
          "MediaType": "text/plain"
        }
      }
    },
    {
      "Name": "OData-Version",
      "Value": "4.0",
      "Type": 2,
      "Encode": false,
      "ContentType": {
        "Value": "text/plain",
        "AsMediaTypeHeaderValue": {
          "CharSet": null,
          "Parameters": [],
          "MediaType": "text/plain"
        }
      }
    },
    {
      "Name": "Strict-Transport-Security",
      "Value": "max-age=31536000",
      "Type": 2,
      "Encode": false,
      "ContentType": {
        "Value": "text/plain",
        "AsMediaTypeHeaderValue": {
          "CharSet": null,
          "Parameters": [],
          "MediaType": "text/plain"
        }
      }
    },
    {
      "Name": "Date",
      "Value": "Wed, 02 Apr 2025 10:17:30 GMT",
      "Type": 2,
      "Encode": false,
      "ContentType": {
        "Value": "text/plain",
        "AsMediaTypeHeaderValue": {
          "CharSet": null,
          "Parameters": [],
          "MediaType": "text/plain"
        }
      }
    },
    {
      "Name": "Server",
      "Value": "nginx",
      "Type": 2,
      "Encode": false,
      "ContentType": {
        "Value": "text/plain",
        "AsMediaTypeHeaderValue": {
          "CharSet": null,
          "Parameters": [],
          "MediaType": "text/plain"
        }
      }
    }
  ],
  "ContentHeaders": [
    {
      "Name": "Content-Length",
      "Value": "70",
      "Type": 2,
      "Encode": false,
      "ContentType": {
        "Value": "text/plain",
        "AsMediaTypeHeaderValue": {
          "CharSet": null,
          "Parameters": [],
          "MediaType": "text/plain"
        }
      }
    },
    {
      "Name": "Content-Type",
      "Value": "application/json; charset=utf-8; odata.metadata=minimal; odata.streaming=true",
      "Type": 2,
      "Encode": false,
      "ContentType": {
        "Value": "text/plain",
        "AsMediaTypeHeaderValue": {
          "CharSet": null,
          "Parameters": [],
          "MediaType": "text/plain"
        }
      }
    }
  ],
  "ResponseStatus": 2,
  "ErrorMessage": null,
  "ErrorException": {
    "ClassName": "System.Net.Http.HttpRequestException",
    "Message": "Request failed with status code BadRequest",
    "Data": null,
    "InnerException": null,
    "HelpURL": null,
    "StackTraceString": null,
    "RemoteStackTraceString": null,
    "RemoteStackIndex": 0,
    "ExceptionMethod": null,
    "HResult": -2146233088,
    "Source": null,
    "WatsonBuckets": null,
    "SafeSerializationManager": {
      "m_serializedStates": [
        {}
      ]
    },
    "CLR_SafeSerializationManager_RealType": "System.Net.Http.HttpRequestException, System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
  },
  "Version": {
    "Major": 1,
    "Minor": 1,
    "Build": -1,
    "Revision": -1,
    "MajorRevision": -1,
    "MinorRevision": -1
  },
  "RootElement": null
}
 
As Admin, you have no restrictions. As a user of group, you can't get something "not visible" to you.
 
Good point, so could be permission related, where do I review that setting?
 
When you request a token, you do it on behalf of a user. That user should be a member of the same group as any of the recording participants. Otherwise, you'll get what you see.
 
When you request a token, you do it on behalf of a user. That user should be a member of the same group as any of the recording participants. Otherwise, you'll get what you see.
Correct, I'm an owner user, that's the same login I'm using via API, which works for 99.9% of the calls.
 
When you request a token, you do it on behalf of a user. That user should be a member of the same group as any of the recording participants. Otherwise, you'll get what you see.
In fact I changed my API user from OWNER to SYSTEM OWNER and now it works lol
This is funny cause OWNER was enough for me all this time till now.
Thank you
 
  • Like
Reactions: Evolute IT

Members Online Now

No members online now.

Forum statistics

Threads
111,843
Messages
589,327
Members
164,679
Latest member
SamadMYK