API requests for custom many-to-many

High-level, we would like an account to have multiple account managers. To handle this, we are adding a custom many-to-many relationship between accounts and users (we have a custom frontend and are using SugarCRM for the backend).

To accommodate this, we created a custom many-to-many relationship between Accounts and Users. The problem I'm having is in figuring out how to create new records via the API. For example, the below POST is interpreted by SugarCRM as me trying to create a new User record:

# Auto-generated table name is `accounts_users_1_c`

The API response indicates that I need to add a user_name, and when I do that, I get a duplicate username error (side note: discrepancy between user_name in the db and "username" in the API error message drives me nuts).

I also tried http://{{host}}{{base_api_path}}/accounts_users_1 but received the "no_method" error. I did notice that a GET to http://{{host}}{{base_api_path}}/Accounts/1/link/accounts_users_1 returns a 200 and an empty array.

How do I create new joins? Any documentation on this would be much appreciated as I haven't been able to find any.

Parents Reply Children
No Data