コード例 #1
0
        /// <summary>
        /// Create tracking pixel Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
        /// </summary>
        /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createTrackingPixelOptions"></param>
        /// <returns>Task of TrackingPixelDto</returns>
        public async System.Threading.Tasks.Task <TrackingPixelDto> CreateTrackingPixelAsync(CreateTrackingPixelOptions createTrackingPixelOptions)
        {
            mailslurp.Client.ApiResponse <TrackingPixelDto> localVarResponse = await CreateTrackingPixelAsyncWithHttpInfo(createTrackingPixelOptions);

            return(localVarResponse.Data);
        }
コード例 #2
0
        /// <summary>
        /// Create tracking pixel Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
        /// </summary>
        /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createTrackingPixelOptions"></param>
        /// <returns>Task of ApiResponse (TrackingPixelDto)</returns>
        public async System.Threading.Tasks.Task <mailslurp.Client.ApiResponse <TrackingPixelDto> > CreateTrackingPixelAsyncWithHttpInfo(CreateTrackingPixelOptions createTrackingPixelOptions)
        {
            // verify the required parameter 'createTrackingPixelOptions' is set
            if (createTrackingPixelOptions == null)
            {
                throw new mailslurp.Client.ApiException(400, "Missing required parameter 'createTrackingPixelOptions' when calling TrackingControllerApi->CreateTrackingPixel");
            }


            mailslurp.Client.RequestOptions localVarRequestOptions = new mailslurp.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            localVarRequestOptions.Data = createTrackingPixelOptions;

            // authentication (API_KEY) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
            {
                localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <TrackingPixelDto>("/tracking/pixels", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("CreateTrackingPixel", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
コード例 #3
0
 /// <summary>
 /// Create tracking pixel Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
 /// </summary>
 /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="createTrackingPixelOptions"></param>
 /// <returns>TrackingPixelDto</returns>
 public TrackingPixelDto CreateTrackingPixel(CreateTrackingPixelOptions createTrackingPixelOptions)
 {
     mailslurp.Client.ApiResponse <TrackingPixelDto> localVarResponse = CreateTrackingPixelWithHttpInfo(createTrackingPixelOptions);
     return(localVarResponse.Data);
 }