Example #1
0
    public async Task <IActionResult> ExecuteAsync(string apiKey)
    {
        //Validate API Key
        APIKey currentAPIKey = await _apiKeyService.GetAPIKeyByKeyAsync(apiKey);

        if (currentAPIKey == null)
        {
            return(Unauthorized());
        }

        IActionResult result = null;

        try
        {
            result =
                await _hubSpotToConstantContactService.TransferContactsFromHubSpotToConstantContact(
                    GetDataFromRequest(),
                    currentAPIKey
                    );
        }
        catch (Exception ex)
        {
            GetErrorJson(ex.Message);
        }

        return(result);
    }
Example #2
0
        public async Task <IActionResult> OnPostReSyncAsync(int?dealId)
        {
            if (dealId == null)
            {
                return(NotFound());
            }

            APIKey key = await _apiKeyService.GetAPIKeyAsync();

            await _hubSpotToConstantContactService
            .TransferContactsFromHubSpotToConstantContact((int)dealId, key);

            return(RedirectToPage("Index"));
        }