Skip to content

Latest commit

 

History

History
100 lines (77 loc) · 3.32 KB

AlipayMerchantImageApi.md

File metadata and controls

100 lines (77 loc) · 3.32 KB

AlipaySDKNet.OpenAPI.Api.AlipayMerchantImageApi

All URIs are relative to https://openapi.alipay.com

Method HTTP request Description
Upload POST /v3/alipay/merchant/image/upload 商户上传处理图片

Upload

AlipayMerchantImageUploadResponseModel Upload (AlipayMerchantImageUploadModel data = null, System.IO.Stream imageContent = null)

商户上传处理图片

商户上传投诉处理、服务咨询的图片接口

Example

using System.Collections.Generic;
using System.Diagnostics;
using AlipaySDKNet.OpenAPI.Api;
using AlipaySDKNet.OpenAPI.Client;
using AlipaySDKNet.OpenAPI.Model;
using AlipaySDKNet.OpenAPI.Util;
using AlipaySDKNet.OpenAPI.Util.Model;

namespace Example
{
    public class UploadExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://openapi.alipay.com";
            var apiInstance = new AlipayMerchantImageApi(config);

            // 设置alipayConfig参数
            AlipayConfig alipayConfig = new AlipayConfig();
            alipayConfig.AppId = "app_id";
            alipayConfig.PrivateKey = "private_key";
            // 密钥模式
            alipayConfig.AlipayPublicKey = "alipay_public_key";
            // 证书模式
            // alipayConfig.AppCertPath = "../appCertPublicKey.crt";
            // alipayConfig.AlipayPublicCertPath = "../alipayCertPublicKey_RSA2.crt";
            // alipayConfig.RootCertPath = "../alipayRootCert.crt";
            alipayConfig.EncryptKey = "encrypt_key";
            AlipayConfigUtil alipayConfigUtil = new AlipayConfigUtil(alipayConfig);
            apiInstance.Client.SetAlipayConfigUtil(alipayConfigUtil);

            var data = new AlipayMerchantImageUploadModel(); // AlipayMerchantImageUploadModel |  (optional) 
            var imageContent = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt"));  // System.IO.Stream |  (optional) 

            try
            {
                // 商户上传处理图片
                AlipayMerchantImageUploadResponseModel result = apiInstance.Upload(data, imageContent);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AlipayMerchantImageApi.Upload: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
data AlipayMerchantImageUploadModel [optional]
imageContent System.IO.Stream****System.IO.Stream [optional]

Return type

AlipayMerchantImageUploadResponseModel

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 common response -
0 请求失败 -

[Back to top] [Back to API list] [Back to README]