[SOLVED] Deal title must be given error while adding a deal

Hello,

I am having trouble adding a new deal on pipedrive. I get the error message “deal title must be given” but i am pretty sure I am giving the title.
Since I couldn’t find any topic on this error, I’m thinking it probably is a mistake I made but I can’t find where it is !

Here is the log i am getting :
The “input” I am sending :
{
contentType: {
Accept: ‘application/json’,
‘Content-Type’: ‘application/x-www-form-urlencoded’
},
body: { title: ‘hey’, person_id: 3045, stage_id: 71 }
}

The code line :
controller.addADeal(input, function(error, response, context) {
if (error) throw error;

    });

and the answer :
{
errorMessage: ‘HTTP Response Not OK’,
errorCode: 400,
errorResponse: ‘{“success”:false,“error”:“Deal title must be given.”,“error_info”:“Visitez developers.pipedrive.com pour en savoir plus sur l\u2019API de Pipedrive.”,“data”:null,“additional_data”:null}’
}

thanks in advance !

Hi Xavier,

It’s a bit difficult to be sure what the error may be (it may be that you’re just need quotes for the Title name “hey”).

Have you had a chance to check it on our Reference page to see if it works for you there?

If not, I would check there and if it works, copy the same Headers and Body and try in Postman.

Let me know if that doesn’t work and you still need help.

Hi David and thank you for this quick reply.

I already tried to change the quotes and I originally used the Reference page to know which data to send. But I just found out that I didn’t know how to use it. I wrote all the “header” section in one parameter of the input, instead of creating a new proprety for each line of the header.

(what I did :
input[“Header”] = { “Accept”: “application/json”,
“Content-Type”: “application/x-www-form-urlencoded” };

what I should have done :
input[“Accept”] = “application/json”;
input[“Content-Type”] = “application/x-www-form-urlencoded”;

1 Like

So thank you and please forgive me for creating this topic for a begginer mistake.

It would be useful for users like me to have a quick guide on how to use the Reference Page, and how to implement the code… But anyway, My problem is solved.

Thank you

Not a problem @Xavier_Fressard. Beginner mistakes happen to all of us :slightly_smiling_face: