海运接口说明
本文档将帮助您快速了解和使用产品功能。目前版本为1.x版本,后续会根据需要对API版本进行持续更新迭代。
本文档将帮助您快速了解和使用产品功能。目前版本为1.x版本,后续会根据需要对API版本进行持续更新迭代。
create 接口,在系统创建海运记录,一次支持最多20个
一、发起请求:
Content-Type: application/json Toolstip-Api-Key: YOUR_API_KEY
| 字段 | 描述 | 
|---|---|
| shipName | 必须,海运公司简码,示例:安通物流的简码为 antong56 ,查看
																	
																		简码列表 | 
| number | 必须,海运单号,示例:安通物流的海运单号为 ATIASUQ220475608 | 
| ctnumber | 必须,集装箱单号,示例:集装箱号 RAWU8047858 | 
二、请求示例
curl -X POST -k "https://api.toolstip.cn/v1/ship/create" 
-H "Content-Type:application/json" 
-H "Toolstip-Api-Key:YOUR_API_KEY" 
-d '[{"shipName":"antong56","number":"ATIASUQ220475608","ctnumber":"RAWU8047858"}]'													三、响应示例
{
	"meta": {
		"code": 200,
		"type": "Success",
		"message": "数据创建成功"
	},
	"data": [{
		"number": "ATIASUQ220475608",
		"shipName": "antong56",
		"des": "入库成功"
	}],
	"error": []
}													
{
	"meta": {
		"code": 202,
		"type": "Success",
		"message": "数据创建失败"
	},
	"data": [],
	"error": [{
		"number": "ATIASUQ220475608",
		"shipName": "antong56",
		"des": "已经存在"
	}]
}													get 接口,根据海运单号或时间条件获取已经创建的海运记录的数据,最大返回200条记录
一、发起请求:
Content-Type: application/json Toolstip-Api-Key: YOUR_API_KEY
| 字段 | 描述 | 
|---|---|
| shipName | 可选,海运公司简码,示例:安通物流的简码为 antong56 ,查看
																	
																		简码列表 | 
| number | 可选,海运单号,示例:安通物流的海运单号为 ATIASUQ220475608 | 
| start | 可选,创建海运记录最小时间,可选格式,日期或时间戳,示例:2022-07-27 12:00 | 
| end | 可选,创建海运记录最大时间,可选格式,日期或时间戳,示例:2022-08-28 12:00 | 
二、请求示例
curl -X GET -k "https://api.toolstip.cn/v1/ship/get?number=ATIASUQ220475608" -H "Content-Type:application/json" -H "Toolstip-Api-Key:YOUR_API_KEY"
三、响应示例
{
	"meta": {
		"code": 200,
		"type": "Success",
		"message": "获取数据成功"
	},
	"data": [{
		"route": [{
			"shipName": "长恒26",
			"voyage": "2238S",
			"counts": "2",
			"POL": "天津",
			"POD": "上海",
			"ETD": "2022-08-28",
			"ATD": "2022-08-28",
			"ETA": "2022-08-30",
			"ATA": "2022-08-30"
		}, {
			"shipName": "华海祥",
			"voyage": "J22043",
			"counts": "2",
			"POL": "上海",
			"POD": "宿迁",
			"ETD": "2022-09-08",
			"ATD": "2022-09-08",
			"ETA": "2022-09-11",
			"ATA": "2022-09-11"
		}],
		"origin": "天津",
		"destination": "宿迁",
		"detail": [{
			"ctnumber": "RAWU8047858",
			"size": "40HQ",
			"weight": "",
			"info": [{
				"date": "2022-09-16 10:27",
				"local": "宿迁",
				"event": "货物送达门点."
			}, {
				"date": "2022-08-23 05:26",
				"local": "天津",
				"event": "集装箱在港口【天津】 出闸"
			}],
			"status": 2,
			"last": "2022-09-16 10:27,宿迁,货物送达门点."
		}, {
			"ctnumber": "RAWU8049017",
			"size": "40HQ",
			"weight": "",
			"info": [{
				"date": "2022-09-16 10:26",
				"local": "宿迁",
				"event": "货物送达门点."
			}, {
				"date": "2022-08-23 14:57",
				"local": "天津",
				"event": "您提交了订舱单,请等待系统确认"
			}, {
				"date": "2022-08-23 06:22",
				"local": "天津",
				"event": "集装箱在港口【天津】 出闸"
			}],
			"status": 2,
			"last": "2022-09-16 10:26,宿迁,货物 送达门点."
		}],
		"status": "In Transit",
		"name": "安通物流  ",
		"nameEn": "An Tong WuLiu",
		"shipName": "antong56",
		"number": "ATIASUQ220475608",
		"updateAt": "2024-08-27 22:29:37"
	}],
	"error": []
}													
{
	"meta": {
		"code": 202,
		"type": "Success",
		"message": "暂无符合条件的数据"
	},
	"data": [],
	"error": []
}													detect 接口,主要用于根据海运单号检测海运公司简码列表,即不知道海运公司简码时使用
一、发起请求:
Content-Type: application/json Toolstip-Api-Key: YOUR_API_KEY
| 字段 | 描述 | 
|---|---|
| number | 必选,海运单号,示例:安通物流的海运单号为 ATIASUQ220475608 | 
二、请求示例
curl -X GET -k "https://api.toolstip.cn/v1/ship/detect" 
-H "Content-Type:application/json" 
-H "Toolstip-Api-Key:YOUR_API_KEY" 
-d "{\"number\":\"ATIASUQ220475608\"}"													三、响应示例
{
	"meta": {
		"code": 200,
		"type": "Success",
		"message": "识别成功"
	},
	"data": [{
		"country": null,
		"code": "ATL",
		"name": "安通物流  ",
		"name_en": "An Tong WuLiu",
		"url": "https:\/\/www.antong56.com"
	}],
	"error": []
}													
{
	"meta": {
		"code": 202,
		"type": "Success",
		"message": "识别失败"
	},
	"data": [],
	"error": []
}													realtime 实时查询接口,实时获取海运数据
一、发起请求:
Content-Type: application/json Toolstip-Api-Key: YOUR_API_KEY
| 字段 | 描述 | 
|---|---|
| shipName | 必须,海运公司简码,示例:安通物流的简码为 antong56 ,查看
																	
																		简码列表 | 
| number | 必须,海运单号,示例:安通物流的海运单号为 ATIASUQ220475608 | 
二、请求示例
curl -X POST -k "https://api.toolstip.cn/v1/ship/create" 
-H "Content-Type:application/json" 
-H "Toolstip-Api-Key:YOUR_API_KEY" 
-d '{"shipName":"antong56","number":"ATIASUQ220475608","ctnumber":"RAWU8047858"}'													三、响应示例
{
	"meta": {
		"code": 200,
		"type": "Success",
		"message": "获取数据成功"
	},
	"data": [{
		"route": [{
			"shipName": "长恒26",
			"voyage": "2238S",
			"counts": "2",
			"POL": "天津",
			"POD": "上海",
			"ETD": "2022-08-28",
			"ATD": "2022-08-28",
			"ETA": "2022-08-30",
			"ATA": "2022-08-30"
		}, {
			"shipName": "华海祥",
			"voyage": "J22043",
			"counts": "2",
			"POL": "上海",
			"POD": "宿迁",
			"ETD": "2022-09-08",
			"ATD": "2022-09-08",
			"ETA": "2022-09-11",
			"ATA": "2022-09-11"
		}],
		"origin": "天津",
		"destination": "宿迁",
		"detail": [{
			"ctnumber": "RAWU8047858",
			"size": "40HQ",
			"weight": "",
			"info": [{
				"date": "2022-09-16 10:27",
				"local": "宿迁",
				"event": "货物送达门点."
			}, {
				"date": "2022-08-23 05:26",
				"local": "天津",
				"event": "集装箱在港口【天津】 出闸"
			}],
			"status": 2,
			"last": "2022-09-16 10:27,宿迁,货物送达门点."
		}, {
			"ctnumber": "RAWU8049017",
			"size": "40HQ",
			"weight": "",
			"info": [{
				"date": "2022-09-16 10:26",
				"local": "宿迁",
				"event": "货物送达门点."
			}, {
				"date": "2022-08-23 14:57",
				"local": "天津",
				"event": "您提交了订舱单,请等待系统确认"
			}, {
				"date": "2022-08-23 06:22",
				"local": "天津",
				"event": "集装箱在港口【天津】 出闸"
			}],
			"status": 2,
			"last": "2022-09-16 10:26,宿迁,货物 送达门点."
		}],
		"status": "In Transit",
		"name": "安通物流  ",
		"nameEn": "An Tong WuLiu",
		"shipName": "antong56",
		"number": "ATIASUQ220475608",
		"updateAt": "2024-08-27 22:29:37"
	}],
	"error": []
}													
{
	"meta": {
		"code": 202,
		"type": "Success",
		"message": "暂无符合条件的数据"
	},
	"data": [],
	"error": []
}													change 接口,修改简码,即将错误的原海运简码改成正确的新海运简码
一、发起请求:
Content-Type: application/json Toolstip-Api-Key: YOUR_API_KEY
| 字段 | 描述 | 
|---|---|
| shipName | 必须,海运公司简码,示例:安通物流的简码为 antong56 ,查看
																	
																		简码列表 | 
| number | 必须,海运单号,示例:安通物流的海运单号为 ATIASUQ220475608 | 
| shipNameNew | 必须,海运公司简码,示例:中远海运的简码为 cosco | 
二、请求示例
curl -X POST -k "https://api.toolstip.cn/v1/ship/create" 
-H "Content-Type:application/json" 
-H "Toolstip-Api-Key:YOUR_API_KEY" 
-d '{"shipName":"antong56","number":"ATIASUQ220475608","shipNameNew":"cosco"}'													三、响应示例
{
	"meta": {
		"code": 200,
		"type": "Success",
		"message": "修改成功"
	},
	"data": [{
		"number": "ATIASUQ220475608",
		"shipName": "antong56",
		"shipNameNew": "cosco"
	}],
	"error": []
}													
{
	"meta": {
		"code": 202,
		"type": "Success",
		"message": "修改失败"
	},
	"data": [],
	"error": [{
		"number": "ATIASUQ220475608",
		"shipName": "antong56",
		"shipNameNew": "aclcargo",
		"des": "修改失败"
	}]
}