Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

dataopen-sdk-nodejs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dataopen-sdk-nodejs

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

openapi 使用说明

Client参数说明

字段类型默认值含义
app_idstring应用的唯一标识符
app_secretstring用于应用的安全认证的密钥
urlstring or null"https://analytics.volcengineapi.com"服务器的URL地址
expirationstring or null"1800"过期时间,单位是秒

client.request参数说明

字段类型默认值含义
service_urlstring请求的服务 URL 地址
methodstring请求的 HTTP 方法,例如 "GET", "POST" 等
headersRecord<string, string>{}请求头,包含的信息如认证凭据,内容类型等
paramsRecord<string, any>{}URL 参数,用于GET请求
bodyRecord<string, any>{}请求体,通常在POST或PUT请求中包含发送的数据

样例

1、Get 方法

import { Client } from "dataopen-sdk-nodejs";

let app_id = "";
let app_secret = "";
let url = "";

let client = new Client(app_id, app_secret, url);

let headers = {};

let params: Record<string, any> = {
  app: 46,
  page_size: 10,
  page: 1,
};

let res = await client.request(
  "/dataopen/open-apis/xxx/openapi/v1/open/flight-list",
  "GET",
  headers,
  params,
);

console.log("Output: ", res);

2、Post 方法

import { Client } from "dataopen-sdk-nodejs";

let app_id = "";
let app_secret = "";
let url = "";

let client = new Client(app_id, app_secret, url);

let headers = {};

let params = {};

let body: Record<string, any> = {
  uid_list: ["1111111110000"],
};

let version_id = 6290880;

let res = await client.request(
  `/dataopen/open-apis/xxx/openapi/v1/open/flight/version/${version_id}/add-test-user`,
  "POST",
  headers,
  params,
  body
);

console.log("Output: ", res);

FAQs

Package last updated on 28 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts