Reputation: 2048
I am very new to Contentful and trying to get all items of one particular content type "companies" from my Contentful database, but I get the error:
`400 Bad Request` response: { "sys": { "type": "Error", "id":
"InvalidQuery" }, "message": "The query you sent was invalid. Probably
a (truncated...) in
My code is:
$client = new Client($accessToken, $spaceID);
$query = new \Contentful\Delivery\Query();
$query->setContentType('hosting_companies');
$entries = $client->getEntries($query);
Does anybody know what I might be missing?
Thanks a lot!
Upvotes: 0
Views: 588
Reputation: 2048
I have found out the source of the problem: In Contentful we called the content type hosting_companies
. Contentful turned that into hostingCompanies
(CamelCase) and I didn't realise that. As soon as I changed the query, it worked.
Upvotes: 2
Reputation: 3879
I'm not 100% fluent in the php sdk but you query for the content type id 'hosting' and in the description you say 'companies'?
Looking at this example in the Contentful documentation the overall structure looks okay.
Upvotes: 1