Rest webservice, relating a document with an opportunity

Rest webservice, relating a document with an opportunity,
I would like to know how I can relate a document to an opportunity in suiteCRM, I am not succeeding for several days.

I am following this documentation, but I have not been able to

I can generate a new document,
I can also generate a new opportunity linked to a specific account.
But I did not see an example of relating a document to an opportunity.


here is how to Set relationship between Documents and Opportunities

if i’m not wrong, it should be something like this

 $relationshipParams = array(
        'sesssion' => $session_id,
        'module_name' => 'Opportunities',
        'module_id' => $Opportunity_id,
        'link_field_name' => 'documents',
        'related_ids' => array(
    $relationshiptResult = call('set_relationship', $relationshipParams, $url);

Hope it helps.

1 Like

Thank you boombata, you saved my day! My problem was with ‘module_id’, I was specifying the documents_opportunities relationship table.
Gratitude for your help. :cheer: :cheer: :cheer: