# Problem to create new lead using rest api

**URL:** <https://forum.mautic.org/t/problem-to-create-new-lead-using-rest-api/3461>\
**Category:** Development\
**Created:** [February 14, 2016, 6:58pm UTC](https://forum.mautic.org/t/problem-to-create-new-lead-using-rest-api/3461 "2016-02-14T18:58:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jocenunes](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jocenunes](https://forum.mautic.org/u/jocenunes)\
**Post date:** [February 14, 2016, 6:58pm UTC](https://forum.mautic.org/t/problem-to-create-new-lead-using-rest-api/3461/1 "2016-02-14T18:58:13Z")

</div>

Hi,  
I have used Rest API OAuth 1a to create a new leads.  
http://develop.fashionlearn.me/allprojectthorughajax  
after authenticating the app,it redirecting to my following callback url ,  
  
http://develop.fashionlearn.me/createleads?oauth\_token=bloq464byhsk4888s84c04o4cos804kkskc8c8o0ko0kggc0c&oauth\_verifier=1fex3sv652tc84kg804cok8g4s044scw80so0owwow0ggwo00  
  
i have written the code here to create a new leads,but it showing me 404 from mautic on my page.  
  
$id=$\_GET["oauth\_verifier"];  
$curl = curl\_init();  
$data = array(  
'firstname' =\> 'Joce',  
'lastname' =\> 'Nuunes',  
'email' =\> 'jocenunes@fashionlearn.com.br',  
'ipAddress' =\> $\_SERVER,  
'owner'=\>$id  
  
);  
curl\_setopt\_array($curl, array(  
CURLOPT\_RETURNTRANSFER =\> 1,  
CURLOPT\_URL =\> 'http://162.243.61.31/leads/2899',  
CURLOPT\_USERAGENT =\> 'Codular Sample cURL Request',  
CURLOPT\_POST =\> 1,  
CURLOPT\_POSTFIELDS =\> $data  
));  
$resp = curl\_exec($curl);  
curl\_close($curl);

---

<div class="post-metadata">

**Author:** ![jocenunes](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jocenunes](https://forum.mautic.org/u/jocenunes)\
**Post date:** [February 14, 2016, 6:58pm UTC](https://forum.mautic.org/t/problem-to-create-new-lead-using-rest-api/3461/2 "2016-02-14T18:58:13Z")

</div>

Hi,  
I have used Rest API OAuth 1a to create a new leads.  
[http://develop.fashionlearn.me/allprojectthorughajax](http://develop.fashionlearn.me/allprojectthorughajax)  
after authenticating the app,it redirecting to my following callback url ,

[http://develop.fashionlearn.me/createleads?oauth\_token=bloq464byhsk4888s84c04o4cos804kkskc8c8o0ko0kggc0c&oauth\_verifier=1fex3sv652tc84kg804cok8g4s044scw80so0owwow0ggwo00](http://develop.fashionlearn.me/createleads?oauth_token=bloq464byhsk4888s84c04o4cos804kkskc8c8o0ko0kggc0c&oauth_verifier=1fex3sv652tc84kg804cok8g4s044scw80so0owwow0ggwo00)

i have written the code here to create a new leads,but it showing me 404 from mautic on my page.

$id=$\_GET[“oauth\_verifier”];  
$curl = curl\_init();  
$data = array(  
‘firstname’ =\> ‘Joce’,  
‘lastname’ =\> ‘Nuunes’,  
‘email’ =\> ‘jocenunes@fashionlearn.com.br’,  
‘ipAddress’ =\> $\_SERVER[‘REMOTE\_ADDR’],  
‘owner’=\>$id

);  
curl\_setopt\_array($curl, array(  
CURLOPT\_RETURNTRANSFER =\> 1,  
CURLOPT\_URL =\> ‘[http://162.243.61.31/leads/2899](http://162.243.61.31/leads/2899)’,  
CURLOPT\_USERAGENT =\> ‘Codular Sample cURL Request’,  
CURLOPT\_POST =\> 1,  
CURLOPT\_POSTFIELDS =\> $data  
));  
$resp = curl\_exec($curl);  
curl\_close($curl);

---

<div class="post-metadata">

**Author:** ![jocenunes](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jocenunes](https://forum.mautic.org/u/jocenunes)\
**Post date:** [February 15, 2016, 6:34pm UTC](https://forum.mautic.org/t/problem-to-create-new-lead-using-rest-api/3461/3 "2016-02-15T18:34:32Z")

</div>

Can anyone please tell me,  
why i am getting response  
after while creating a new leads using outh 1a.

{“error”:{“message”:“parameter\_absent”,“code”:400}}

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [February 15, 2016, 9:57am UTC](https://forum.mautic.org/t/problem-to-create-new-lead-using-rest-api/3461/4 "2016-02-15T09:57:12Z")

</div>

Duplicate of [https://www.mautic.org/community/index.php/2729-url-not-found-after-authenticating/p1#p8135](https://www.mautic.org/community/index.php/2729-url-not-found-after-authenticating/p1#p8135) . Please, do not spam the same questions all over this forum otherwise you’ll piss the people answering it.

---

<div class="post-metadata">

**Author:** ![jocenunes](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jocenunes](https://forum.mautic.org/u/jocenunes)\
**Post date:** [February 15, 2016, 12:59pm UTC](https://forum.mautic.org/t/problem-to-create-new-lead-using-rest-api/3461/5 "2016-02-15T12:59:42Z")

</div>

Yes, I apologize.
