Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [api]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
27 views

Limit External API Calls From Plugin In Craft 2

I have a plugin in Craft 2 that will make an API call to an external API to gather and display data on a template; however, I would like to limit the number of calls to a certain number per second (or ...
buck1112's user avatar
  • 400
1 vote
2 answers
121 views

Setting up Feed Me with and API Auth Token that changes every 15mins

I have setup a feed using Feed Me and have added the Authorization header token but the API changes the Auth token every 15min. Which I need to copy paste into the config file. Is there an easy setup ...
Stu00's user avatar
  • 38
0 votes
2 answers
31 views

Craft 2 Caching RESTful API Results Displayed On Page

I have made a php plugin in Craft 2 which calls a RESTful API and displays the results on the template. The data is returned at about 8 seconds. I've surrounded the call to the plugin on the ...
buck1112's user avatar
  • 400
0 votes
0 answers
29 views

Feed me config setup

I am trying to do an import of course data into craft but I am running into a problem with the feed me config (feed-me.php). He is the curl request I want to run and this works and outputs the data I ...
bhackett's user avatar
  • 137
0 votes
0 answers
101 views

How to fetch data from pagination URL with Feed Me plugin

I have a pagination URL http://example.com/v3/?limit=12&page=1 I try this code: {% set page = craft.app.request.getParam('p') %} {% set params = { url: 'http://example.com/v3/?limit=12&...
user2707393's user avatar
1 vote
1 answer
149 views

Call external API when event is firing

I would like to send a post request to an API when a new order in in Craft Commerce is paid. So I've got this event into a plugin: Event::on( Order::class, OrderStatuses::class,...
Davide's user avatar
  • 35
1 vote
1 answer
449 views

Updating to Craft 4 breaks plugin settings: must not be accessed before initialization

I maintain a plugin. Inside this plugin's composer.json, extra>handle is set to pizza (not the real name). In one of the controllers, the following code is executed: $apiKey = Plugin::$plugin->...
Paul Hübner's user avatar
1 vote
1 answer
149 views

How to generate a token, retrieve it and delete it

I have a workflow were a user will be given a link, with a token attached to it, upon clicking that link, the token will be read from the query string, if it is valid the user will be presented a ...
Wally's user avatar
  • 343
1 vote
0 answers
185 views

Using tokens to authenticate a one-time download link?

I am trying to create a download link to an ASSET in craft that I can send via email - the client clicks the email link (which has a token query string attached to validate the link) and is presented ...
Wally's user avatar
  • 343
1 vote
1 answer
58 views

GraphQL fields with applied typogrify - any suggestions?

we love CraftCMS and also typogrify plugin with Twig filter "|typogrify". Now we are starting a web project that will combine Astro and CraftCMS will be used headless with the use of GraphQL ...
jan.reges's user avatar
1 vote
1 answer
108 views

Configuring Craft 3 with Sparkpost - SMTP - email errors

I created a basic Sparkpost account and am trying to connect it to Craft to send email notifications. When I click the 'test' button in Craft, I get "there was an error testing your email ...
4midori's user avatar
  • 656
1 vote
1 answer
370 views

How to make a external GraphQL API request?

I want to query some data from another domain. I dont want to to do it in JS (client side) because I want the content right in place on the page. I tried with several options and variations with the ...
Simon Franzen's user avatar
1 vote
1 answer
100 views

Returning Metadata Fields with GraphQL?

I'm trying to pull as much information from the CMS as possible via the GraphQL API. I can't seem to find any info about how to extract the metadata information for the various entries in the CMS. At ...
Ailish's user avatar
  • 21
1 vote
1 answer
491 views

Creating an asset from an API using a module

I'm currently making a module that I'm hoping is going to create entries and assets from an API. I've got the entries part working and now I'm trying to create an asset from a URI of an image. I've ...
Jack Nixon's user avatar
0 votes
0 answers
867 views

Maximum Response Size in GraphQL API?

hoping someone can point me in the right direction here. I'm trying to query my client's API with the Graphiql interface. My use case requires me to extract quite a lot of data from their system but ...
Ailish's user avatar
  • 21
1 vote
1 answer
391 views

How does Craft CMS gets data from a 3rd part API?

I have an event page for viewing movies showtime and i want to connect to a 3rd party api to get the movie's info ( show time, cinema name,...etc ) how to do it? can i do this without having to create ...
Ra3d K's user avatar
  • 125
1 vote
1 answer
63 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 ...
Cole Henley's user avatar
  • 1,741
0 votes
0 answers
377 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('...
joomkit's user avatar
  • 2,024
1 vote
0 answers
46 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 ...
Nasser Ali Karimi's user avatar
1 vote
1 answer
71 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.
Alan Kimrey's user avatar
1 vote
1 answer
373 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 ...
matty_rj45's user avatar
1 vote
2 answers
163 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? ...
Deepak Kale's user avatar
0 votes
1 answer
271 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 ...
Lee's user avatar
  • 139
1 vote
2 answers
810 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" ...
Adam Tsai's user avatar
1 vote
1 answer
32 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/...
Cole Henley's user avatar
  • 1,741
0 votes
0 answers
320 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 ...
nfo's user avatar
  • 101
4 votes
1 answer
1k 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 ...
nitech's user avatar
  • 679
1 vote
1 answer
1k 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/...
Katie Fritz's user avatar
2 votes
2 answers
2k 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 ...
nitech's user avatar
  • 679