# Segment API 404 Problem

**URL:** <https://forum.mautic.org/t/segment-api-404-problem/14452>\
**Category:** Product Support\
**Created:** [May 22, 2020, 12:25pm UTC](https://forum.mautic.org/t/segment-api-404-problem/14452 "2020-05-22T12:25:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenzo1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lorenzo1/32/738_2.png) [@lorenzo1](https://forum.mautic.org/u/lorenzo1)\
**Post date:** [May 22, 2020, 12:25pm UTC](https://forum.mautic.org/t/segment-api-404-problem/14452/1 "2020-05-22T12:25:18Z")

</div>

**Your software**  
My Mautic version is:2.16.2  
My PHP version is:7.2

I’m developing some API calls from Joomla to Mautic,  
I’m testing all the calls with Postman that produce the php code for me.  
With this method I was able to create, delete, edit, search contact; triggering points etc… etc…

In Postman add a contact to a segment works perfectly but when I export the php curl code and I test it I receive a 404 error. But the code is straightforward.

I’ve cleaned the cache as suggested.

I’ve added a buffer to understand better what’s is going on, what I dont’ understand is “Mark bundle as not supporting multiuse”, and the 404 error.

Can someone help me to solve / understand the problem?  
Thanks.

**The code:**  
$curl = curl\_init();

curl\_setopt\_array($curl, array(  
CURLOPT\_URL =\> “[https://www.mail.istitutomedicinanaturale.it/api/segments/1/contact/2499/add](https://www.mail.istitutomedicinanaturale.it/api/segments/1/contact/2499/add)”,  
CURLOPT\_RETURNTRANSFER =\> true,  
CURLOPT\_ENCODING =\> “”,  
CURLOPT\_MAXREDIRS =\> 10,  
CURLOPT\_TIMEOUT =\> 0,  
CURLOPT\_FOLLOWLOCATION =\> true,  
CURLOPT\_HTTP\_VERSION =\> CURL\_HTTP\_VERSION\_1\_1,  
CURLOPT\_CUSTOMREQUEST =\> “POST”,  
CURLOPT\_HTTPHEADER =\> array(  
“Authorization: Basic XXXXXXXXXX=”,  
“Cookie: mautic\_device\_id=cd94dcnjnlg6dk5meoyt7uc; mautic\_session\_id=cd94dcnjnlg6dk5meoyt7uc; cd94dcnjnlg6dk5meoyt7uc=23708; 35e9fb9389ff18d92ea40662974709c9=73568dc6147610fcef78d271f3733226”  
),  
));

$response = curl\_exec($curl);

curl\_close($curl);  
echo $response;

**The buffer output:**  
string(1458) "\* Trying 185.81.4.186:443…  
Connected to www.mail.istitutomedicinanaturale.it (185.81.4.186) port 443 (#0)  
ALPN, offering http/1.1  
successfully set certificate verify locations:  
CAfile: /etc/pki/tls/certs/ca-bundle.crt  
CApath: none  
SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384\* ALPN, server accepted to use http/1.1  
Server certificate:  
subject: CN=mail.istitutomedicinanaturale.it  
start date: May 1 11:52:00 2020 GMT  
expire date: Jul 30 11:52:00 2020 GMT  
subjectAltName: host “www.mail.istitutomedicinanaturale.it” matched cert’s “www.mail.istitutomedicinanaturale.it”  
issuer: C=US; O=Let’s Encrypt; CN=Let’s Encrypt Authority X3  
SSL certificate verify ok.  
POST /api/segments/1/contact/2499/add HTTP/1.1  
Host: www.mail.istitutomedicinanaturale.it  
Accept: _/_  
Accept-Encoding: deflate, gzip, br  
Authorization: Basic XXXXXXXXXX=  
Cookie: mautic\_device\_id=cd94dcnjnlg6dk5meoyt7uc; mautic\_session\_id=cd94dcnjnlg6dk5meoyt7uc; cd94dcnjnlg6dk5meoyt7uc=23708; 35e9fb9389ff18d92ea40662974709c9=73568dc6147610fcef78d271f3733226

Mark bundle as not supporting multiuse  
HTTP/1.1 404 Not Found  
Date: Fri, 22 May 2020 12:11:03 GMT  
Server: Apache  
Cache-Control: no-cache  
Vary: Authorization  
Upgrade: h2,h2c  
Connection: Upgrade  
Transfer-Encoding: chunked  
Content-Type: application/json

Connection #0 to host www.mail.istitutomedicinanaturale.it left intact

---

<div class="post-metadata">

**Author:** ![lorenzo1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lorenzo1/32/738_2.png) [@lorenzo1](https://forum.mautic.org/u/lorenzo1)\
**Post date:** [May 22, 2020, 12:40pm UTC](https://forum.mautic.org/t/segment-api-404-problem/14452/2 "2020-05-22T12:40:13Z")

</div>

Solved:  
In my case the HTTP\_VERSION have to be 2.0.  
change from:  
CURLOPT\_HTTP\_VERSION =\> CURL\_HTTP\_VERSION\_1\_1  
to:  
CURLOPT\_HTTP\_VERSION =\> CURL\_HTTP\_VERSION\_2\_0

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [May 22, 2020, 12:42pm UTC](https://forum.mautic.org/t/segment-api-404-problem/14452/3 "2020-05-22T12:42:14Z")

</div>

Glad to hear you found the solution - thanks for taking the time to report back!

---

<div class="post-metadata">

**Author:** ![lorenzo1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lorenzo1/32/738_2.png) [@lorenzo1](https://forum.mautic.org/u/lorenzo1)\
**Post date:** [May 22, 2020, 12:43pm UTC](https://forum.mautic.org/t/segment-api-404-problem/14452/4 "2020-05-22T12:43:10Z")

</div>

I hope that the post is “solved” if not, please tell me how mark the post as solved

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [May 22, 2020, 12:46pm UTC](https://forum.mautic.org/t/segment-api-404-problem/14452/5 "2020-05-22T12:46:32Z")

</div>

Yes, it is marked as solved 🎉
