Save Data from live website using Hook

ok i have 4 fields first_name , last_name , status , lead_source how should i manage to write these in postman inside rest_data?

Hi,
when you’re having a session id, you can use set_entry as method. rest_data could contain something like:

{
	"session" : "{{sessionid}}",
	"module_name" : "{{target_module}}",
	"name_value_list" : {
                   "name" : "{{some_name}}",
		           "custom_field_c" : "{{some_value}}" 
	}
}

within name_value_list, you can add as many attributes as needed.

note: those {{ and }} are meant for postmans internal variables. You can simply use strings and remove those curly brackets.

Ok Fine but now its giving below things

what i am doing wrong this time ??

in your previous screenshot, you selected “form-data” as body type. change it to “x-www-form-urlencoded”.

Now getting nothing in response sir

But you’re getting an error (500) - have a look at your json, remove unnecessary line breaks and commas.

{

“session” :“76550d4a09394c0b34e524706ac12e6b”,
“module” : “Leads”,
“name_value_list” : {
“first_name” : “Namit”,
“last_name” : “Singh Verma”,
“status”: “New”,
“lead_source”: “Facebook” ,
}
}

this is the code.

Try removing the comma after “Facebook”.

okay now giving response Thanks but
below is the response message.

the session id that i am using is getting from i have written code in my suitecrm/test.php when i run this then i get id but that id is not valid

http://ramjethmalanimoot.com/namit/suitecrm/test.php

by hitting this i am getting id

the session id becomes invalid quite fast, try getting a new one with the login-method.

its giving invalid login

using below code in rest_data

{
‘user_auth’,
‘user_name’ : “username”,
‘password’:
“21232f297a57a5a743894a0e4a801fc3”
}
}

try this please:

{
     "user_auth" : {  
         "user_name":"{{rest4user}}",
          "password":"{{rest4pw}}",
           "version":"1"
      },
     "application_name":"some test value"
}

and verify your json structure, the one you posted is malformed.

Thank you so much its working fine now. Means a lot to me.

1 Like