# Outputs from Campaign API endpoint are not getting sorted alphabetically

**URL:** <https://forum.mautic.org/t/outputs-from-campaign-api-endpoint-are-not-getting-sorted-alphabetically/32963>\
**Category:** Product Support\
**Created:** [July 31, 2024, 2:20pm UTC](https://forum.mautic.org/t/outputs-from-campaign-api-endpoint-are-not-getting-sorted-alphabetically/32963 "2024-07-31T14:20:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [July 31, 2024, 2:20pm UTC](https://forum.mautic.org/t/outputs-from-campaign-api-endpoint-are-not-getting-sorted-alphabetically/32963/1 "2024-07-31T14:20:10Z")

</div>

**Your software**  
My Mautic version is: 4.4.12  
My PHP version is: 7.4.33  
My Database type and version is: 10.3.39-MariaDB

**Your problem**  
My problem is:  
I am making an API call to:  
“[https://mautic.ddev.site/api/campaigns?limit=5000&published=1&orderby=name](https://mautic.ddev.site/api/campaigns?limit=5000&published=1&orderby=name)”

It is not returning the output in alphabetical order, but the segment and email endpoints with the same parameters is outputting everything nicely ordered. Is that by chance a bug, or am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [August 6, 2024, 7:00pm UTC](https://forum.mautic.org/t/outputs-from-campaign-api-endpoint-are-not-getting-sorted-alphabetically/32963/2 "2024-08-06T19:00:48Z")

</div>

i guess it’s a typo in your query. please try `orderBy` instead of `orderby`  
😉

---

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [August 6, 2024, 8:33pm UTC](https://forum.mautic.org/t/outputs-from-campaign-api-endpoint-are-not-getting-sorted-alphabetically/32963/3 "2024-08-06T20:33:08Z")

</div>

Yes that has resolved it. The strange thing: The other endpoints are working also with lowercase, but this one is not.

---

<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:** [August 8, 2024, 8:33am UTC](https://forum.mautic.org/t/outputs-from-campaign-api-endpoint-are-not-getting-sorted-alphabetically/32963/4 "2024-08-08T08:33:59Z")

</div>

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