Beispiel #1
0
        /// <summary>The method to upsert records</summary>
        /// <param name="moduleAPIName">string</param>
        /// <param name="request">Instance of BodyWrapper</param>
        /// <param name="headerInstance">Instance of HeaderMap</param>
        /// <returns>Instance of APIResponse<ActionHandler></returns>
        public APIResponse <ActionHandler> UpsertRecords(string moduleAPIName, BodyWrapper request, HeaderMap headerInstance)
        {
            CommonAPIHandler handlerInstance = new CommonAPIHandler();

            string apiPath = "";

            apiPath = string.Concat(apiPath, "/crm/v2/");

            apiPath = string.Concat(apiPath, moduleAPIName.ToString());

            apiPath = string.Concat(apiPath, "/upsert");

            handlerInstance.APIPath = apiPath;

            handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST;

            handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_ACTION;

            handlerInstance.ContentType = "application/json";

            handlerInstance.Request = request;

            handlerInstance.Header = headerInstance;

            Utility.GetFields(moduleAPIName);

            handlerInstance.ModuleAPIName = moduleAPIName;

            return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json"));
        }
Beispiel #2
0
        /// <summary>The method to update record using external id</summary>
        /// <param name="externalFieldValue">string</param>
        /// <param name="moduleAPIName">string</param>
        /// <param name="request">Instance of BodyWrapper</param>
        /// <param name="headerInstance">Instance of HeaderMap</param>
        /// <returns>Instance of APIResponse<ActionHandler></returns>
        public APIResponse <ActionHandler> UpdateRecordUsingExternalId(string externalFieldValue, string moduleAPIName, BodyWrapper request, HeaderMap headerInstance)
        {
            CommonAPIHandler handlerInstance = new CommonAPIHandler();

            string apiPath = "";

            apiPath = string.Concat(apiPath, "/crm/v2.1/");

            apiPath = string.Concat(apiPath, moduleAPIName.ToString());

            apiPath = string.Concat(apiPath, "/");

            apiPath = string.Concat(apiPath, externalFieldValue.ToString());

            handlerInstance.APIPath = apiPath;

            handlerInstance.HttpMethod = Constants.REQUEST_METHOD_PUT;

            handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_UPDATE;

            handlerInstance.ContentType = "application/json";

            handlerInstance.Request = request;

            handlerInstance.Header = headerInstance;

            handlerInstance.ModuleAPIName = moduleAPIName;

            Utility.GetFields(moduleAPIName, handlerInstance);

            return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json"));
        }
Beispiel #3
0
        /// <summary>The method to remove territories from record</summary>
        /// <param name="moduleAPIName">string</param>
        /// <param name="id">long?</param>
        /// <param name="request">Instance of BodyWrapper</param>
        /// <returns>Instance of APIResponse<ActionHandler></returns>
        public APIResponse <ActionHandler> RemoveTerritoriesFromRecord(string moduleAPIName, long?id, BodyWrapper request)
        {
            CommonAPIHandler handlerInstance = new CommonAPIHandler();

            string apiPath = "";

            apiPath = string.Concat(apiPath, "/crm/v2.1/");

            apiPath = string.Concat(apiPath, moduleAPIName.ToString());

            apiPath = string.Concat(apiPath, "/");

            apiPath = string.Concat(apiPath, id.ToString());

            apiPath = string.Concat(apiPath, "/actions/remove_territories");

            handlerInstance.APIPath = apiPath;

            handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST;

            handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_UPDATE;

            handlerInstance.ContentType = "application/json";

            handlerInstance.Request = request;

            handlerInstance.ModuleAPIName = moduleAPIName;

            Utility.GetFields(moduleAPIName, handlerInstance);

            return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json"));
        }