REST API

Hi,

I am trying to bulk reassign contacts assigned from one user to another one using REST API

First I am trying to filter all records assigned to one user but once I run this filter, only first record is assigned to that user and all the rest seems random and assigned to other users like the filter only worked for the first record.

Am I using filter incorrectly?

Secondly, how to use the filter to pull only specific fields? E.g. Only return a list of all contact names ("name") assigned to user "abcd" from Contacts module

Parents
  • Hi  I have a couple of questions about the filtering feature:

    • Is it completely safe to go from GET to the POST request to do all the filtering or are there any restrictions to be considered?
    • The "fields" parameter is optional.:
    1. What happens to the ResultSet in case I do not send this parameter? Only the "required fields" will be returned or all of the fields?
    2. There are some cases in which when querying the endpoint with the list of all fields returned by the metadata throws an error.(500 Internal Server Error). It'd be helpful to see on the documentation the restrictions that may be present. Ie. Module: Opportunities. These are the fields that throw an error when added to the fields list on the URL: (What is the logic behind this? How can I distinguish which field not to include in fields filter?)

    Relationships:

    1- Does this endpoint return the EXACT same results as filtering the Contact module with account_id IN(....) so that I can filter with more than 1 relation id? https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_11.0/Integration/Web_Services/REST_API/Endpoints/modulerecordlinklink_name_GET/

    2- Do we have a way to perform a "join" where for instance: I have a relation "contacts" linking between ContactModule and Accounts module with type many-to-may? I'd like to get in 1 single Json all the fields from module Contacts and module Accounts just like inner joining them in Database

Reply
  • Hi  I have a couple of questions about the filtering feature:

    • Is it completely safe to go from GET to the POST request to do all the filtering or are there any restrictions to be considered?
    • The "fields" parameter is optional.:
    1. What happens to the ResultSet in case I do not send this parameter? Only the "required fields" will be returned or all of the fields?
    2. There are some cases in which when querying the endpoint with the list of all fields returned by the metadata throws an error.(500 Internal Server Error). It'd be helpful to see on the documentation the restrictions that may be present. Ie. Module: Opportunities. These are the fields that throw an error when added to the fields list on the URL: (What is the logic behind this? How can I distinguish which field not to include in fields filter?)

    Relationships:

    1- Does this endpoint return the EXACT same results as filtering the Contact module with account_id IN(....) so that I can filter with more than 1 relation id? https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_11.0/Integration/Web_Services/REST_API/Endpoints/modulerecordlinklink_name_GET/

    2- Do we have a way to perform a "join" where for instance: I have a relation "contacts" linking between ContactModule and Accounts module with type many-to-may? I'd like to get in 1 single Json all the fields from module Contacts and module Accounts just like inner joining them in Database

Children