抖音开放api接口汇总(抖音开放平台接口)

网友投稿 1565 2023-01-31

本篇文章给大家谈谈抖音开放api接口汇总,以及抖音开放平台接口对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 今天给各位分享抖音开放api接口汇总的知识,其中也会对抖音开放平台接口进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

抖店开放平台request_id来源

抖音-抖店开放平台SDK:https://github.com/cnJun/sdk4-jinritemai,该 SDK 实现了抖店开放平台(https://op.jinritemai.com/) API 接口调用和消息推送验证解析,SDK 仅依赖 fastjson 来做 JSON 格式数据的解析。
API 接口
该 SDK 适用于自用型应用和工具型应用,他们的差别仅存在于获取授权的方式不一样:
获取调用 Client
自用型应用
对于自用型应用,不需要传 access token,SDK 中会自动进行 access token 的获取以及刷新处理(https://op.jinritemai.com/docs/guide-docs/9/21)。
DoudianClient client = new DefaultDoudianClient(serverUrl, appKey, appSecret);
工具型应用
工具型应用授权说明:https://op.jinritemai.com/docs/guide-docs/9/22
对应工具型应用,判断店铺是否已经授权,未授权需要先进行授权,授权成功后需要将相关授权信息存储下来以便后续调用或者 access token 过期后进行刷新。
店铺授权(未授权或授权过期)
用户授权成功后,回调配置的地址,并返回 code 参数(url参数)。使用 code 换取 access token 等授权信息。
DoudianClient client = new DefaultDoudianClient(serverUrl, appKey, appSecret);
if (!accessToken.isSuccess()) {
// code 换取 access token 失败
} else {
// 存储该授权店铺的信息
// accessToken 授权token
// expiresIn 有效期(秒)
// shopId 店铺id
// shopName 店铺名
// refreshToken 刷新token
// 计算 access token 过期时间(向前推1分钟)
int expiresIn = accessToken.getExpiresIn();
long expire = System.currentTimeMillis() + (expiresIn - 60) * 1000;
根据授权信息获取 DoudianClient
根据店铺id获取该店铺授权信息,判断 access token 是否已过期,过期则使用 refresh token 刷新授权,并将新的授权信息进行存储,以便后续使用。
DoudianClient client = new DefaultDoudianClient(serverUrl, appKey, appSecret);
// 根据店铺id获取店铺授权信息,并创建 accessToken 对象
DoudianAccessToken accessToken = new DoudianAccessToken();
accessToken.setAccessToken(店铺授权token);
accessToken.setExpiresIn(店铺授权token过期时间);
accessToken.setExpire(店铺授权token过期时间点);
accessToken.setRefreshToken(店铺授权刷新token);
client.setAccessToken(accessToken);
if (!accessToken.isValid()) {
accessToken = client.getAccessToken(accessToken.getRefreshToken());
if (accessToken.isValid()) {
// 存储该店铺新的授权信息
// accessToken 授权token
// expiresIn 有效期(秒)
// shopId 店铺id
// shopName 店铺名
// refreshToken 刷新token
// 计算 access token 过期时间(向前推1分钟)
int expiresIn = accessToken.getExpiresIn();
long expire = System.currentTimeMillis() + (expiresIn - 60) * 1000;
}
}
if (!accessToken.isValid()) {
// 授权获取失败
throw new RuntimeException("授权获取失败");
SDK 调用类名规则
请求类:将 method 参数,转换成相应的首字母大写驼峰名,然后加 Doudian 前缀,加 Request 后缀,即为 API 请求对象类名,例如:获取订单列表接口,method 为 order.list,转换为首字母大写驼峰 OrderList,再加前缀/后缀后,请求类名 DoudianOrderListRequest
响应类:将 method 参数,转换成相应的首字母大写驼峰名,然后加 Doudian 前缀,加 Response 后缀,即为 API 请求对象类名,例如:获取订单列表接口,method 为 order.list,转换为首字母大写驼峰 OrderList,再加前缀/后缀后,响应类名 DoudianOrderListResponse
调用方式:
// 创建 client,自用型应用或工具型应用创建方式略有不同,详解上一节说明
DoudianClient client = getClient();
// 构建请求类
请求类 request = new 请求类();
// 设置请求参数
request.setXX1();
request.setXX2();
request.setXX3();
......
// 调用 API
响应类 response = client.execute();
if (response.isSuccess()) {
// 调用成功,进行业务处理
} else {
// 调用失败,进行错误处理
// 错误代码:response.getErrNo();
对返回值的一些说明
目前已知接口,返回结构均为:
{
"err_no": 0, // 返回代码,0 表示成功;非 0 表示失败
"message": "success", // err_no 非 0 时表示调用错误信息
对于分页类数据的返回,各个接口使用的参数名不一样,比如:获取商品列表接口将数据列表放在 data 上,而获取订单列表接口则将数据列表放在 list 上,为了统一处理分页类数据返回,可以通过如下方法来统一返回分页相关信息:
DoudianPage<业务数据类 page = response.getData();
page.getTotal(); // 总记录数
page.getPageNumber(); // 当前页数
店铺API
获取店铺的已授权品牌列表
API 接口:https://op.jinritemai.com/docs/api-docs/13/54
DoudianShopBrandListRequest request = new DoudianShopBrandListRequest();
DoudianShopBrandListResponse response = getClient().execute(request);
if (response.isSuccess()) {
List<DoudianShopBrand shopBrandList = response.getData();
System.out.println("获取品牌信息:" + shopBrandList.size());
} else {
获取店铺后台供商家发布商品的类目
API 接口:https://op.jinritemai.com/docs/api-docs/13/234
DoudianShopGetShopCategoryRequest request = new DoudianShopGetShopCategoryRequest();
request.setCid(0L);
DoudianShopGetShopCategoryResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.out.println("获取失败:" + response.getMessage());
} else {
for (DoudianShopCategory shopCategory : response.getData()) {
System.out.print(repeat(" ", (shopCategory.getLevel() - 1) * 2));
System.out.println(shopCategory.getId() + "," + shopCategory.getName());
商品API
获取商品详情
API 接口:https://op.jinritemai.com/docs/api-docs/14/56
DoudianProductDetailRequest request = new DoudianProductDetailRequest();
request.setProductId(3453347975240268172L);
DoudianProductDetailResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取商品详情失败:" + response.getMessage());
} else {
DoudianProduct product = response.getData();
获取商品列表
API 接口:https://op.jinritemai.com/docs/api-docs/14/57
DoudianProductListRequest request = new DoudianProductListRequest();
DoudianProductListResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取商品列表失败:" + response.getMessage());
} else {
for (DoudianProduct product : response.getData().getPageData()) {
System.out.println(JSON.toJSONString(product));
添加商品
API 接口:https://op.jinritemai.com/docs/api-docs/14/59
DoudianProductAddRequest request = new DoudianProductAddRequest();
request.setName("米奇牛仔裤");
request.setPic("https://sf6-ttcdn-tos.pstatp.com/obj/temai/2d5bb85c2e7f919f403ed6372a8ddc9fwww800-800");
request.setDescription("https://sf6-ttcdn-tos.pstatp.com/obj/temai/2d5bb85c2e7f919f403ed6372a8ddc9fwww800-800");
request.setMarketPrice(10000);
request.setDiscountPrice(10000);
request.setMobile("13400000001");
request.setWeight("110");
request.setProductFormat("{"货号":"KZZL025","适用季节":"冬季"}");
request.setPayType(1);
request.setSpecId("134794584");
request.setCategoryLeafId("20597");
DoudianProductAddResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("添加商品失败:" + response.getMessage());
} else {
编辑商品
API 接口:https://op.jinritemai.com/docs/api-docs/14/60
DoudianProductEditRequest request = new DoudianProductEditRequest();
request.setProductId(1L);
request.setName("米奇牛仔裤");
request.setPic("https://sf6-ttcdn-tos.pstatp.com/obj/temai/2d5bb85c2e7f919f403ed6372a8ddc9fwww800-800");
request.setDescription("https://sf6-ttcdn-tos.pstatp.com/obj/temai/2d5bb85c2e7f919f403ed6372a8ddc9fwww800-800");
request.setMarketPrice(10000);
request.setDiscountPrice(10000);
request.setMobile("13400000001");
request.setWeight("110");
request.setProductFormat("{"货号":"KZZL025","适用季节":"冬季"}");
request.setPayType(1);
request.setSpecId("134794584");
request.setCategoryLeafId("20597");
DoudianProductEditResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("编辑商品失败:" + response.getMessage());
} else {
删除商品
API 接口:https://op.jinritemai.com/docs/api-docs/14/61
DoudianProductDelRequest request = new DoudianProductDelRequest();
request.setProductId(1L);
DoudianProductDelResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("删除商品失败:" + response.getMessage());
} else {
添加规格
API 接口:https://op.jinritemai.com/docs/api-docs/14/62
DoudianSpecAddRequest request = new DoudianSpecAddRequest();
request.setSpecs("颜色|白色,红色,蓝色^尺码|S,M,L");
request.setName("规格2021-1");
DoudianSpecAddResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("添加规格失败:" + response.getMessage());
} else {
获取规格详情
API 接口:https://op.jinritemai.com/docs/api-docs/14/63
DoudianSpecSpecDetailRequest request = new DoudianSpecSpecDetailRequest();
request.setId(145957862L);
DoudianSpecSpecDetailResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取规格详情失败:" + response.getMessage());
} else {
for (DoudianSpec spec : response.getData()) {
System.out.println(JSON.toJSONString(spec));
获取规格列表
API 接口:https://op.jinritemai.com/docs/api-docs/14/64
DoudianSpecListRequest request = new DoudianSpecListRequest();
DoudianSpecListResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取规格列表失败:" + response.getMessage());
} else {
for (DoudianSpec spec : response.getData()) {
System.out.println(JSON.toJSONString(spec));
删除规格
API 接口:https://op.jinritemai.com/docs/api-docs/14/65
DoudianSpecDelRequest request = new DoudianSpecDelRequest();
request.setId(145957862L);
DoudianSpecDelResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("删除规格失败:" + response.getMessage());
} else {
添加SKU
API 接口:https://op.jinritemai.com/docs/api-docs/14/81
DoudianSkuAddRequest request = new DoudianSkuAddRequest();
request.setProductId(3453183170894243915L);
request.setSpecId(115584464L);
request.setSpecDetailIds("981648008|981648010");
request.setStockNum(1);
request.setPrice(10100);
DoudianSkuAddResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("添加SKU失败:" + response.getMessage());
} else {
获取商品sku列表
API 接口:https://op.jinritemai.com/docs/api-docs/14/82
DoudianSkuListRequest request = new DoudianSkuListRequest();
request.setProductId(3453347975240268174L);
DoudianSkuListResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取商品sku列表失败:" + response.getMessage());
} else {
for (DoudianSku sku : response.getData()) {
System.out.println(JSON.toJSONString(sku));
订单API
获取订单列表
API 接口:https://op.jinritemai.com/docs/api-docs/15/55
DoudianOrderListRequest request = new DoudianOrderListRequest();
request.setStartTime("2020-12-01 00:00:00");
request.setEndTime("2020-12-31 00:00:00");
DoudianOrderListResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取订单列表失败:" + response.getMessage());
} else {
DoudianPage<DoudianOrder page = response.getData();
for (DoudianOrder order : page.getPageData()) {
System.out.println(JSON.toJSONString(order));
获取订单详情
API 接口:https://op.jinritemai.com/docs/api-docs/15/68
DoudianOrderDetailRequest request = new DoudianOrderDetailRequest();
request.setOrderId("4736605172296554197A");
DoudianOrderDetailResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取订单详情失败:" + response.getMessage());
} else {
DoudianPage<DoudianOrder page = response.getData();
for (DoudianOrder order : page.getPageData()) {
System.out.println(JSON.toJSONString(order));
确认货到付款订单
API 接口:https://op.jinritemai.com/docs/api-docs/15/69
DoudianOrderStockUpRequest request = new DoudianOrderStockUpRequest();
request.setOrderId("4736605172296554197A");
DoudianOrderStockUpResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("确认货到付款订单失败:" + response.getMessage());
} else {
取消货到付款订单
API 接口:https://op.jinritemai.com/docs/api-docs/15/72
DoudianOrderCancelRequest request = new DoudianOrderCancelRequest();
request.setOrderId("4736605172296554197A");
DoudianOrderCancelResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("取消货到付款订单失败:" + response.getMessage());
} else {
获取服务请求列表
API 接口:https://op.jinritemai.com/docs/api-docs/15/74
DoudianOrderServiceListRequest request = new DoudianOrderServiceListRequest();
DoudianOrderServiceListResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取服务请求列表失败:" + response.getMessage());
} else {
回复服务请求
API 接口:https://op.jinritemai.com/docs/api-docs/15/75
DoudianOrderReplyServiceRequest request = new DoudianOrderReplyServiceRequest();
request.setId("1");
request.setReply("回复信息");
DoudianOrderReplyServiceResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("回复失败:" + response.getMessage());
} else {
添加订单备注
API 接口:https://op.jinritemai.com/docs/api-docs/15/141
DoudianOrderAddOrderRemarkRequest request = new DoudianOrderAddOrderRemarkRequest();
request.setOrderId("4736605172296554197A");
request.setRemark("sh订单");
request.setIsAddStar(true);
request.setStar(1);
DoudianOrderAddOrderRemarkResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("添加订单备注失败:" + response.getMessage());
} else {
物流发货API
获取快递公司列表
API 接口:https://op.jinritemai.com/docs/api-docs/16/76
DoudianOrderLogisticsCompanyListRequest request = new DoudianOrderLogisticsCompanyListRequest();
DoudianOrderLogisticsCompanyListResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("获取快递公司列表失败:" + response.getMessage());
} else {
for (DoudianOrderLogisticsCompany logisticsCompany : response.getData()) {
System.out.println(JSON.toJSONString(logisticsCompany));
订单发货
API 接口:https://op.jinritemai.com/docs/api-docs/16/77
DoudianOrderLogisticsAddRequest request = new DoudianOrderLogisticsAddRequest();
request.setOrderId("4736605172296524197A");
request.setLogisticsId(15L);
request.setCompany("中通快递");
request.setLogisticsCode("75417914223203");
DoudianOrderLogisticsAddResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("发货失败:" + response.getMessage());
} else {
修改发货物流
API 接口:https://op.jinritemai.com/docs/api-docs/16/79
DoudianOrderLogisticsEditRequest request = new DoudianOrderLogisticsEditRequest();
request.setOrderId("4736605172296524197A");
request.setLogisticsId(15L);
request.setCompany("中通快递");
request.setLogisticsCode("75417914223203");
DoudianOrderLogisticsEditResponse response = getClient().execute(request);
if (!response.isSuccess()) {
System.err.println("修改发货物流失败:" + response.getMessage());
} else {
消息推送
消息推送服务接入指南:https://op.jinritemai.com/docs/guide-docs/10/99
使用 SDK 验证解析抖店消息推送示例:
@PostMapping(抖音店铺数据推送URL,主要需要去掉权限验证)
public DouyinPushResult<Map doudianShopDataPush(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) {
DoudianPushResult result = new DoudianPushResult();
DoudianPushMessage pushMessage = DoudianUtils.getPushMessage(httpRequest);
if (!pushMessage.isSuccess()) {
result.setCode(40041);
result.setMsg("解析推送数据失败");
} else if (DoudianUtils.isEmpty(pushMessage.getData())) {
result.setCode(40041);
result.setMsg("解析推送数据为空");
} else {
List<DoudianPushData pushDataList = pushMessage.getData();
// 推送地址添加后,平台会立即Post一条"[{"tag":"0","msg_id":"0","data":"2020-09-10T16:27:56.52842897+08:00"}]"的测试消息,
// 必须返回{"code":0,"msg":"success"}
if (pushDataList.size() == 1 "0".equals(pushDataList.get(0).getTag())) {
result.setCode(0);
result.setMsg("success");
} else {
// 业务处理
for (DoudianPushData pushData : pushDataList) {
if ("100".equals(pushData.getTag())) {
DoudianTradeTradeCreate100 tradeCreate100 = pushData.toObject(DoudianTradeTradeCreate100.class);
// 具体业务处理
}
}
if (true) {
// 接收处理成功
result.setCode(0);
result.setMsg("success");
} else {
// 接收处理失败
result.setCode(40044);
result.setMsg("接收处理失败消息");
}
}
}
电商ERP应用



抖音API,item_get_video - 获取抖音视频详情

API 返回结果

Request address:

https://api-gw.onebound.cn/douyin/item_get_video/?key=

item_id=7092264344980868359⟨=zh-CNsecret=

---------------------------------------

Result Object:

---------------------------------------

{

"item": {

"num_iid": "7092264344980868359",

"detail_url": "https://www.iesdouyin.com/share/video/7092264344980868359/?region=∣=7090863251021515533u_code=0did=MS4wLjABAAAANwkJuWIRFOzg5uCpDRpMj4OX-QryoDgn-yYlXQnRwQQiid=MS4wLjABAAAANwkJuWIRFOzg5uCpDRpMj4OX-QryoDgn-yYlXQnRwQQwith_sec_did=1titleType=title",

"title": "修以美好,与君相遇#就算无人欣赏也要独自芬芳",

"type": "video",

"nick": "花草日记 . 麦麦",

"signature": "?不谈悲喜、只闻花香\n\n?手机随拍、装点生活",

"uid": "5698411035",

"short_id": "969898359",

"video": {

"url": "https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fg10000c9mcherc77ufa73socn0∶=720pline=0",

"url_raw": "https://aweme.snssdk.com/aweme/v1/play/?video_id=v0200fg10000c9mcherc77ufa73socn0∶=720pline=0",

"pic_url": "https://p26-sign.douyinpic.com/tos-cn-p-0015/871cb3034d9b4073bd2aa8960bff93fd~c5_300x400.jpeg?x-expires=1654650000x-signature=zqA99cM8lYhPNJjlWBEqIB2%2FhLg%3Dfrom=4257465056_larges=PackSourceEnum_DOUYIN_REFLOWse=false≻=coverl=202205250927520102121020910031A442"

},

"music": {

"title": "@若然若创作的原声一若然若",

"nick": "若然若",

"url": "https://sf3-cdn-tos.douyinstatic.com/obj/ies-music/7090863247943109407.mp3",

"pic_url": "https://p3.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_1e7c8177679e3c9b4743da4968714762.jpeg?from=116350172"

},

"item_imgs": []

},

"error": "",

"reason": "",

"error_code": "0000",

"cache": 0,

"api_info": "today:3 max:10100 all[27=3+4+20]",

"execution_time": "0.392",

"server_time": "Beijing/2022-05-25 09:27:53",

"client_ip": "106.6.37.232",

"call_args": [],

"api_type": "douyin",

"translate_language": "zh-CN",

"translate_engine": "google_new",

"server_memory": "0.72MB",

"request_id": "gw-4.628d8618af7b7",

"last_id": "985134675"

}

抖音js接口是什么

是主流开发模式。
1、JS接口为主流App开发模式NativeApp,传统原生APP开发模式。
2、Android基于Java语言,底层调用Google的API,iOS基于OC或者Swift语言,底层调用ios官方提供的API。
3、WebApp,网站开发模式。将页面部署在服务器上,用户使用浏览器访问,一般泛指SPA(SinglePageApplication)模式开发出的网站。
4、HybridApp,半Native半web混合开发模式。
5、介于WebApp、NativeApp两者之间,兼具Native良好交互体验和Web页跨平台开发优势。
6、ReactNativeApp用JS写出的原生应用。

关于抖音开放api接口汇总和抖音开放平台接口的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。 抖音开放api接口汇总的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于抖音开放平台接口、抖音开放api接口汇总的信息别忘了在本站进行查找喔。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:工商银行免费api(工商银行免费领腾讯视频会员)
下一篇:工商信息免费api(工商免费咨询电话)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~