API set_realtionship

Hi and Good day,

I am very new to suiteCRM so if anyone could help me out it would be much appreciated.

I have the Accounts module that is in a one-to-many relationship with a custom called Trips
I am currently trying to (via API calls) populate users Account and then Trip details .
The set_entry works well for each individually but I am struggling on how to get them to connect.

I have attempted to use the set_ relationship which looks like this: (POSTMAN EXTRACT)

The trp_trips_accounts being the name i see in the set relationship page.

I am not sure if this is the best way to go about this?
I also read about adding a parent_id but there wasn’t to much information on that

Any information would be much appreciated.

You can find good example in file:
of your SuiteCRM installation.

@ p.konetskiy thank you very much for the help!

I was eventually able to figure out what i needed to do so would just like to leave it behind in case someone else has the same issue:

It still uses set_relationship for the method
and JSON as input and response type
then the rest data is as below:


“module_name”: “Accounts”,

“module_id”:"", //this is for the Account you want to create the relationship with.

“link_field_name”:“trp_trips_accounts”, //name in the set relationship page in your application

“related_ids”:[""],// the ids of the Trips you want to be connected to the Account: Note is Array.

“name_value_list”:[“ACCOUNT”,“TRIP”], //this works if you leave Account and trip out as well

“delete”:“0” //delete 0= create relationship ; delete 1=delete relationship