Zapier is not loading all tags (only first 30)

Your software
Zapier

Your problem
My problem is: When I create a new contact from Zapier, I can not select all of my tags in Mautic to be added to the contact. It appears that only 30 tags are loaded.

Steps I have tried to fix the problem:

  1. Deleted the Mautic cache (by filesystem and console)
    => nothing changed

  2. Changed the name of the tag to 0.tagname
    => now the tag it is showing up as expected (without clearing the cache)

I’ve load all tag ok, above 30 tags (Team plan). What zapier plan you are using? Do you contact to zapier?

Thanks, @huuich. I’m on the free plan.

I did some more digging and my API is also only returning 30 entries. This is expected since it is the default behavior based on the documentation:

curl --location --request GET 'https://m.domain.com/api/tags/' \
--header 'Authorization: Basic *********'

It says the total is 64. Returned are only the first 30 entries.

Response:

{
    "total": 64,
    "tags": {
        "324": {
            "id": 324,
            "tag": "0-gmail-import"
        },
        "7": {
            "id": 7,
            "tag": "ai"
        },
...
        "321": {
            "id": 321,
            "tag": "ai-breakout"
        },

        "28": {
            "id": 28,
            "tag": "education"
        }
    }
}

I guess one could change the limit, however it seems that the limit parameter is ignored:

curl --location --request GET 'https://m.domain.com/api/tags/?limit=1' \
--header 'Authorization: Basic *********'

@adiux does it make any difference if you do https://m.domain.com/api/tags?limit=1 (without the last forward slash) instead of https://m.domain.com/api/tags/?limit=1 ? Just curious

Thank you @dennisameling. Yes that worked! So with this, I’m able to control the number of tags returned from the API. If I set the limit to 1, I get:

{
    "total": 64,
    "tags": {
        "324": {
            "id": 324,
            "tag": "0-gmail-import"
        }
    }
}

Do I need to change something on my server, or how can I get all tags returned to Zapier?

1 Like

So in the docs it says:

Limit number of entities to return. Defaults to the system configuration for pagination (30).

Based on that I found the following config parameter in config/local.php:

'default_pagelimit' => 30,

if you change that to a higher number (e.g. 100) it should do the trick for you

Thank you @dennisameling, I guess this will fix it for now.

But I assume this creates some new performance problems. E.g if a plugin is fetching contacts (who have a lot of data), relies on paging, and does not manually specify the limit.

I guess the safest option would be to use the search functionality from Zapier. Based on the documentation the Mautic API is providing a search parameter. So the call would be something like this (not working for me):

curl --location --request GET 'https://m.domain.com/api/tags?search=gmail&limit=30' \
--header 'Authorization: Basic ************'
1 Like

Could be something to look into for the Zapier integration. There are some improvements to the integration in progress already: https://trello.com/c/XakKsEn1/7-zapier-plugin-update

You should try n8n.io (alternative to zapier)

Thanks @huuich. Looks interesting.