Questions tagged [api]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

Manipulating search event

Looking at a means to perform subqueries against certain searches in the back-end of the Craft CMS eg for searches against particular sections within Admin > Entries. Looking into this it seems ...
0
votes
0answers
45 views

Guzzle fatal error using Craft Guzzle client

Using the code below to get 3rd party API $uri = $baseUri . '/area/' . $areaId . '.geojson?api_key=' . $mapAPIkey; $client = Craft::createGuzzleClient(); $response= $client->request('...
0
votes
0answers
27 views

GraphQL API query to load all related data

How to write a query to load entries with its category or any other related data. For example I have cars that related to the BMW category. How I can access the category data in the query that fetch ...
1
vote
1answer
26 views

Element API - lightswitch option to exclude an entry from a feed

I'm trying to exclude an entry based on the state of a lightswitch field in the entry itself. If true, exclude the entry from the feed, if false include the entry.
1
vote
1answer
65 views

Craftcms 3 Module - API call validation (on EVENT_BEFORE_SAVE, EVENT_BEFORE_VALIDATE, EVENT_AFTER_VALIDATE, EVENT_AFTER_SAVE)

I am trying to validate entries on Save in a Module. My specific use case requires that the Entry validation - on failure to validate will return user to form with field errors. On successful ...
0
votes
0answers
13 views

Make getSerializedFieldValues include fields from related entries

I am looking for a way to make getSerializedFieldValues (or simiular) include fields from related elements. Today I use the code from Craft-Scout's default ElementTransformer, which gives a decent ...
1
vote
2answers
49 views

How to develop API with TWIG

I want to develop an API within Twig template that will have PDO implementation to get data. My application will be using content through CRAFT. Is it possible to develop API with TWIG template? ...
0
votes
1answer
121 views

Schedule plugin not working for Feed Me plugin

I have created a schedule to run the 'Feed Me' every 1 minute using the plugin 'Schedule', but it doesn't work. I not sure am I using the correct setting or not. I manage to get the latest data if I ...
1
vote
2answers
179 views

How to query EntryQuery for multiple sections with varying types

I think the best way to pose this question is by giving an example: Given a variable $query of type craft\elements\db\EntryQuery, I'd like to get entries from 2 different sections: "people" ...
1
vote
1answer
24 views

Craftnet API package query

Does querying composer packages via the Craftnet API need authentication? Ref https://docs.api.craftcms.com/packages.html Querying the Craft CMS package itself is fine, eg https://api.craftcms.com/v1/...
0
votes
0answers
139 views

Rest Controller and API Rate Limits or how to set CSRF token invalid

Problem: I have a JSON endpoint and like to limit access to it. I.e. to prevent double submits on contact forms or brute force attempts. One solution that came to my mind was rate-limiting the ...
3
votes
1answer
590 views

How to accept incoming webhooks?

I've tested the webhooks plugin. Awesome. Works brilliantly. How how about incoming webhooks? What if my 3rd party ERP system has changes that it wants to put into my Craft site. How do I go about ...
1
vote
1answer
613 views

How to correctly format API requests for Mandrill using Fetch plugin? Getting error "you must specify a key value"

I want to use the Fetch plugin (v 1.2.0; Craft Pro 3.3.13) to send messages from a Twig template in some circumstances. To test the setup, I'm just trying to ping Mandrill, according to the /users/...
2
votes
2answers
1k views

How to update (or CRUD) products (or entries) via API?

I want to update certain fields of a product (or entry) from a 3rd party. I see some talk about plugins and some refer to this .all talk about Creating a RESTful API with Craft 3. I found the Craft ...