API 是指应用程序编程接口,我们通过 API 接口可以实现特定的功能,而不需要了解其内部实现细节。可以把 API 接口理解为是特定服务的一种封装,将服务封装起来提供给他人调用,这样一来很多功能不需要从新开发。 

       1、API 可以将多个平台的数据和功能相互集成。 例如,您可以将您的电商网站 / 平台与物流运输服务供应商的账户集成,并导入订单和运输数据。 这样,你就只需在一个平台上进行快递运输操作。

       2、API 可以快速获取电商平台商品信息,如淘宝、天猫、1688、京东、亚马逊等平台商品,再通过 API 接口,可实现一键铺货,节省大量上传商品的时间,把时间花在更有价值的事情上。

       3、电商订单仓储管理 API 可以通过集成 API 进行诸如订单履行、快递管理、标签管理、发票管理、订单打印、货运信息、物流跟踪和签收通知等等的功能来帮助企业实现订单管理、发货管理和运输管理的自动化,简化其物流仓储运营,从而实现成本降低。

1、公共参数

请求地址: https://api-gw.onebound.cn/yiwugo/item_get

名称 类型 必须 描述
key String 调用key(必须以GET方式拼接在URL中)
secret String 调用密钥
api_name String API接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等]
cache String [yes,no]默认yes,将调用缓存的数据,速度比较快
result_type String [json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读
lang String [cn,en,ru]翻译语言,默认cn简体中文
version String API版本

2、请求参数

请求参数:num_iid=931405691

参数说明:num_iid:商品ID

3、响应参数

Version: Date:

名称 类型 必须 示例值 描述

num_iid

String 0 931405691 宝贝ID

title

String 0 商品标题

desc_short

String 0 商品简介

pic_url

String 0 //img1.yiwugou.com/i004/2020/05/16/40/49909083d829a807db6af05f3fad993e.png 宝贝图片

min_num

Int 0 1

num

Int 0 2191

express_fee

Float 0 EMS费用

shipping_to

String 0 shipping_to 发货至

nick

String 0 卫红女装制衣厂义乌篁园市场 卖家昵称

detail_url

String 0 http://www.yiwugo.com/product/detail/931405691.html 宝贝链接

desc

String 0

seller_id

Int 0 卖家ID

sales

Int 0 销售额

seller_info

Mix 0 {"desc": "卫红女装制衣厂实体经营中高档女装,款式新颖价格实惠,欢迎全国各地的顾客前来咨询订购", "dizhi": "", "nick": "卫红女装制衣厂义乌篁园市场", "seller_name": "", "user_num_id": "", "phone": "", "QQ": ""} 卖家信息

shop_id

Int 0 店铺ID

item_imgs

Mix 0 [{"url": "//img1.yiwugou.com/i004/2020/05/16/40/49909083d829a807db6af05f3fad993e.png"}] 商品图片列表

props_list

Mix 0 {} 商品属性

skus

Mix 0 {"sku": [{"properties": "0:0", "properties_name": "0:0:颜色:小号", "price": "7.70", "orginal_price": "7.70", "quantity": 716, "sku_id": 3184603612387 }]} 商品规格信息列表

price

Float 0 149 价格

4、请求示例

//using System.Net.Security;
//using System.Security.Cryptography.X509Certificates;
private const String method = "GET";
static void Main(string[] args)
{
	String bodys = "";
	// 请求示例 url 默认请求参数已经做URL编码
	String url = "https://api-gw.onebound.cn/yiwugo/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=931405691";
	HttpWebRequest httpRequest = null;
	HttpWebResponse httpResponse = null; 
	if (url.Contains("https://"))
	{
		ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
		httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
	}
	else
	{
		httpRequest = (HttpWebRequest)WebRequest.Create(url);
	}
	httpRequest.Method = method;
	if (0 < bodys.Length)
	{
		byte[] data = Encoding.UTF8.GetBytes(bodys);
		using (Stream stream = httpRequest.GetRequestStream())
		{
		stream.Write(data, 0, data.Length);
		}
	}
	try
	{
		httpResponse = (HttpWebResponse)httpRequest.GetResponse();
	}
	catch (WebException ex)
	{
		httpResponse = (HttpWebResponse)ex.Response;
	}
	Console.WriteLine(httpResponse.StatusCode);
	Console.WriteLine(httpResponse.Method);
	Console.WriteLine(httpResponse.Headers);
	Stream st = httpResponse.GetResponseStream();
	StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
	Console.WriteLine(reader.ReadToEnd());
	Console.WriteLine("\n");
}
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
	return true;
}

Logo

电商企业物流数字化转型必备!快递鸟 API 接口,72 小时快速完成物流系统集成。全流程实战1V1指导,营造开放的API技术生态圈。

更多推荐