Question about using the rest API with related records

Hello,

I have successfully been able to create related records using the /<module>/:record/link/:link_name POST endpoint.

And I have successfully been able to list all of the related records to a specific record using the /<module>/:record/link/:link_name GET endpoint.

However I have not been able to find in the documentation a way to list all of the related records between two modules?  Say that I wanted to retrieve all of the links between accounts and projects.  How would I be able to do that?

Thanks.

Bryan Hunt

Parents Reply Children
  • Hi Bryan,

    I believe you'd like to retrieve the Many-To-Many record that ties 2 modules together huh?

    The underlying structure of tables is all handled by Sugar and there's no API for it, you could definitely write your own Sugar Query for that but I'd like to understand your requirement first. 

    It's very unusual for you to manipulate that join table yourself other than the following methods:

    Please share your requirements with us, perhaps there's a better way of doing this:

    GET /<module>/:record/link/:link_name | Retrieve a module's records related to another
    module's record
    POST
    /<module>/:record/link/:link_name/:remote_id | Relate a module's record to another module's
    record
    DELETE
    /<module>/:record/link/:link_name/:remote_id | Delete a relationship between two module’s
    records

    rafa

    SugarCRM | Principal Developer Advocate