Menu
Welcome, Guest
Username: Password: Remember me

TOPIC: API V8 does not return any lists (Error: "Expected data to be a string; received "array"")

API V8 does not return any lists (Error: "Expected data to be a string; received "array"") 2 months 1 week ago #85815

  • SMD19
  • SMD19's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Thank you received: 1
  • Karma: 0
Hi SuiteCRM community,

I can request single entities via API (/api/v8/modules/Accounts/61...0d?fields[Accounts]=name), but for lists (/api/v8/modules/Accounts?fields[Accounts]=name) I get the following response:
{
    "errors": [
        {
            "code": 0,
            "title": "Generate JSON API Response exception detected: InvalidArgumentException: Invalid HTTP status code (0)",
            "status": 400
        },
        {
            "id": "1",
            "links": {
                "about": null
            },
            "status": "200",
            "code": 0,
            "title": "JSON API Error",
            "detail": "JSON API Error occurred.",
            "source": {
                "pointer": null,
                "parameter": null
            },
            "meta": {
                "about": "Exception",
                "class": "RuntimeException",
                "code": 0
            }
        }
    ],
    "meta": {
        "suiteapi": {
            "major": 8,
            "minor": 0,
            "patch": 0,
            "stability": "ALPHA"
        }
    },
    "jsonapi": {
        "version": "1.0"
    }
}

In the suitecrm.log I see the desired result with all Accounts in the log file, but before there's an error message:
Wed Jun 12 16:57:52 2019 [115][9527537f-f31e-1c55-a0cf-5981a28334e9][FATAL] Expected data to be a string; received "array"
Wed Jun 12 16:57:52 2019 [115][9527537f-f31e-1c55-a0cf-5981a28334e9][FATAL] [ERROR] [Invalid Payload Response]{"links":[],"data":[{"id":"135a0...4f111","type":"Accounts","attributes":{"name":"H\u00f...G"},"relationships":{"created_by....

The data is the list of all Accounts, so for me it seems OK that data is an array...
Is this a known bug or a misconfiguration on our side?
The administrator has disabled public write access.

API V8 does not return any lists (Error: "Expected data to be a string; received "array"") 1 month 1 week ago #86860

  • SMD19
  • SMD19's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Thank you received: 1
  • Karma: 0
My bad.
I used the deprecated endpoints "/api/v8/..." instead new "/Api/V8/...".

Everything works now.
The administrator has disabled public write access.
The following user(s) said Thank You: pgr
Time to create page: 0.030 seconds
Powered by Kunena Forum