# LIST TEXT MESSAGES VIA API

**URL:** <https://forum.mautic.org/t/list-text-messages-via-api/31731>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [April 18, 2024, 2:15am UTC](https://forum.mautic.org/t/list-text-messages-via-api/31731 "2024-04-18T02:15:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eloimarques](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/eloimarques/32/11810_2.png) [@eloimarques](https://forum.mautic.org/u/eloimarques)\
**Post date:** [April 18, 2024, 2:15am UTC](https://forum.mautic.org/t/list-text-messages-via-api/31731/1 "2024-04-18T02:15:10Z")

</div>

**Your software**  
_My PHP version is_ : PHP Version 7.4.33  
_My MySQL/MariaDB version is_ (delete as applicable): 10.4.28-MariaDB-1:10.4.28+maria~ubu2004

_My problem is_ : I’m trying to retrieve via API only the SMS campaigns that have the status “Published” but this isn’t working.

If I’m not mistaken, according to the documentation ([Mautic Developer Documentation](https://developer.mautic.org/#list-text-messages)) I just need to pass the “publishedOnly” parameter through the API, but this simply isn’t working for me.

I’m testing this via Postman. All my other interactions with the API work normally. This just doesn’t return what you want.

I’ve passed the parameter in all the ways below but it doesn’t work.

{{api\_uri}}/smses?publishedOnly

{{api\_uri}}/smses?publishedOnly=true

{{api\_uri}}/smses?publishedOnly=1

{{api\_uri}}/smses?search=&publishedOnly

{{api\_uri}}/smses?search=a&publishedOnly

I would like to know if there is any specific way to pass this parameter so that it works, in case I am doing something wrong.

Thanks.

---

<div class="post-metadata">

**Author:** ![kuzmanyy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kuzmanyy/32/390_2.png) [@kuzmanyy](https://forum.mautic.org/u/kuzmanyy)\
**Post date:** [April 18, 2024, 2:14pm UTC](https://forum.mautic.org/t/list-text-messages-via-api/31731/2 "2024-04-18T14:14:16Z")

</div>

API copies search like you search in UI.  
It should look like

```auto
{{api_uri}}/smses?search=is:published

```

---

<div class="post-metadata">

**Author:** ![eloimarques](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/eloimarques/32/11810_2.png) [@eloimarques](https://forum.mautic.org/u/eloimarques)\
**Post date:** [April 18, 2024, 7:59pm UTC](https://forum.mautic.org/t/list-text-messages-via-api/31731/3 "2024-04-18T19:59:42Z")

</div>

Thank you! It’s works…

Maybe I’m wrong, but I didn’t see anything in the documentation talking about this.

Still, thank you very much!

---

<div class="post-metadata">

**Author:** ![eloimarques](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/eloimarques/32/11810_2.png) [@eloimarques](https://forum.mautic.org/u/eloimarques)\
**Post date:** [April 18, 2024, 8:47pm UTC](https://forum.mautic.org/t/list-text-messages-via-api/31731/4 "2024-04-18T20:47:42Z")

</div>

Still on this topic, can you tell me if it would be possible to filter by publishup and publishdown data?

I looked for this in the documentation ( [Searching Mautic — Mautic Documentation 0.1 documentation](https://docs.mautic.org/en/5.x/search/search_operators.html)) but didn’t find any mention of it either.

Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [April 20, 2024, 8:48am UTC](https://forum.mautic.org/t/list-text-messages-via-api/31731/5 "2024-04-20T08:48:17Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
