跳转到主要内容
1签 (OneSign)

查询完整签名权益

本页内容

查询企业签名应用的套餐、有效期和当前权益。

适用场景

开通前确认现状,或签名前检查服务是否可用时使用。

开始前

请先在开发者中心完成 API 接入配置,并为目标应用授予本次操作所需的权限。尚未完成首次调用时,请先阅读快速开始。

  • 使用企业签名应用 ID。需要查看套餐、退款规则或安装量权益时,从此接口取得当前状态。
所需权限
enterprise:ReadEntitlements;附带统计还需 ReadStatistics 及现有统计审批
认证方式
长期 AccessKey(AKP),服务端 HMAC 签名

权限、应用范围和来源 IP 均需符合接入配置。详细说明见访问权限。

调用步骤

  1. 确认目标企业签名应用 ID。
  2. 读取套餐、有效期、证书与安装量限制。
  3. 按需要检查可执行的开通、续费或签名操作。

尚未开通时选择余额购买或密钥开通;服务有效时可继续签名。

请求方式

GET /api/v1/apps/{app_id}/signing-entitlement
操作标识
getSigningEntitlement
请求域名
https://www.onesignios.com
频率限制
账号与 API 应用的额度同时生效。达到限额时按 Retry-After 等待。

请求参数

字段必填说明
app_id 是

业务应用的完整 ID,来自列出应用或预留新应用的响应。

类型:string · 位置:Path

查看取值约束
  • 格式 ^A[a-f0-9]{32}$

示例:A11111111111111111111111111111111

AccessKey 认证请求头

下表适用于 AccessKey 调用,由服务端 SDK 自动生成。使用长期或临时凭据自行实现 HTTP 调用时,请按照请求签名说明处理。

字段必填说明
Authorization 是

AccessKey 调用的认证签名,格式为 CS1-HMAC-SHA256 Credential=密钥ID,Signature=签名。使用 SDK 时自动生成。

类型:string · 位置:Header

X-Api-Date 是

UTC 时间,格式 YYYY-MM-DDTHH:mm:ssZ。与服务器的时间偏差最多 300 秒。

类型:string · 位置:Header

查看取值约束
  • 数据格式 date-time
X-Api-Nonce 是

每次请求生成 16 个随机字节,转为 32 位小写十六进制。重试时重新生成。

类型:string · 位置:Header

查看取值约束
  • 格式 ^[a-f0-9]{32}$
X-Api-Content-Sha256 是

实际发送的正文原始字节的 SHA-256 小写十六进制。GET 计算空字节串。

类型:string · 位置:Header

查看取值约束
  • 格式 ^[a-f0-9]{64}$
X-Api-Environment 是

生产环境传 production。

类型:string · 位置:Header

查看取值约束
  • 固定值 production

本接口仅支持长期 AccessKey,不支持临时凭据或 OAuth Bearer。查看认证方式对照。

请求体

GET 请求不发送正文。签名中的正文摘要取零字节内容的 SHA-256。

成功响应

HTTP 200 返回 JSON。请记录 request_id,排查问题时可提供此值。查看成功、失败与异步结果的区别。

如何判断结果

state 区分未开通、有效和过期。结合证书状态、安装量限制和退款规则判断下一步,不能只比较套餐到期时间。

first_recorded_activation_at 可能为空,不能用上传时间补成首次开通时间;此查询也不会自动开通或提交签名。

返回字段

字段按对象层级列出,[] 表示数组元素。“必返”指该对象出现时字段是否必须存在,值仍可能允许为 null;具体类型见展开说明。

字段必返说明
request_id 是

平台生成的请求标识。排查问题时请提供此值。

类型:string

查看取值约束
  • 格式 ^[a-f0-9]{32}$

示例:00000000000000000000000000000000

data 是

本次调用的业务结果,结构取决于操作。

类型:object

data.app_id 是

当前账号授权的企业签名应用。

类型:string

查看取值约束
  • 格式 ^A[a-f0-9]{32}$

示例:A11111111111111111111111111111111

data.generated_at 是

查询时刻 UTC 秒,权益和准入仍会在后续写入时重新核实。

类型:integer

查看取值约束
  • 最小值 0

示例:1793937600

data.state 是

not_activated 未开通、active 有效、expired 已到期;该状态不代表一定可以成功提交任务。

类型:string

查看取值约束
  • 可选值 not_activated / active / expired
  • active — 有效
  • expired — 已过期

示例:active

data.plan_id 是

当前套餐编号,0 未分类、1 基础版、2 高级版、3 独立版。

类型:integer

查看取值约束
  • 最小值 0

示例:2

data.plan_name 是

当前套餐展示名称。

类型:string

查看示例

示例:高级版

data.sign_expires_at 是

当前签名有效期到期 UTC 秒;0 表示未开通。

类型:integer

查看取值约束
  • 最小值 0

示例:1796529600

data.remaining_seconds 是

距到期的剩余秒数,不小于零。

类型:integer

查看取值约束
  • 最小值 0

示例:2592000

data.first_recorded_activation_at 是

当前权益台账中最早记录的开通时刻;缺失为 null,不能拿上传时间代替。

类型:integer | null

查看取值约束
  • integer (最小值 0)

示例:1793937600

data.application_status 是

normal 正常、pending_review 待审核、blocked 被锁定。

类型:string

查看取值约束
  • 可选值 normal / pending_review / blocked

示例:normal

data.certificate 是

当前已分配的同套餐证书公开信息;缺失、重复或套餐不符为 null。

类型:object | null

data.certificate.id 是

该条记录的公开标识。调用后续接口时请完整保留,包括前缀。

类型:string

查看取值约束
  • 格式 ^C[a-f0-9]{32}$

示例:C77777777777777777777777777777777

data.certificate.label 是

用于选择和区分证书的公开备注。

类型:string

查看取值约束
  • 最多字符 255

示例:R2

data.certificate.team 是

证书对应的团队信息。

类型:string

查看取值约束
  • 最多字符 255

示例:Fixture Team

data.certificate.certificate_expires 是

证书本身的到期时间文本,不是签名套餐的到期时间。

类型:string

查看取值约束
  • 最多字符 80

示例:2027-12-31

data.certificate.profile_expires 是

描述文件本身的到期时间文本。

类型:string

查看取值约束
  • 最多字符 80

示例:2027-12-31

data.certificate.selected 是

此证书是否为当前应用已选用的证书。

类型:boolean

查看示例

示例:true

data.certificate_state 是

assigned 当前已分配同套餐证书的公开信息;unavailable 表示缺失、重复或套餐不匹配。

类型:string

查看取值约束
  • 可选值 assigned / unavailable

示例:assigned

data.installation_limit 是

应用级安装量上限与跨版本去重规则。

类型:object

data.installation_limit.maximum_devices 是

应用级唯一设备上限,0 表示不限;不逐版本重复计费。

类型:integer

查看取值约束
  • 最小值 0

示例:1000

data.installation_limit.unlimited 是

上限为 0 时为 true。

类型:boolean

查看示例

示例:false

data.installation_limit.cross_version_deduplicated 是

同一应用跨版本按设备指纹去重,不是系统真实 UDID。

类型:boolean

查看取值约束
  • 固定值 true

示例:true

data.verification 是

后续签名使用的验证库与等待提示配置,不代表当前安装包授权结果。

类型:object

data.verification.injection_enabled 是

后续签名是否注入平台验证库;不是授权通过状态。

类型:boolean

查看示例

示例:true

data.verification.ui_mode 是

后续签名生效的等待提示方案,不改变授权、到期和安装量规则。

类型:integer

查看取值约束
  • 可选值 1 / 2 / 3

示例:3

data.verification.ui_inherited 是

是否跟随全局默认验证提示方式。

类型:boolean

查看示例

示例:true

data.verification.applies_to_next_signature 是

上述配置用于后续签名,不能据此推断已有安装包所带配置。

类型:boolean

查看取值约束
  • 固定值 true

示例:true

data.refund_policy 是

网站当前全局退款政策;实际退款资格须查询指定原 API 订单。

类型:object

data.refund_policy.window_seconds 是

当前全局余额订单退款窗口,仍需查询指定 API 订单资格。

类型:integer

查看取值约束
  • 最小值 0

示例:86400

data.refund_policy.daily_supported 是

当前按天余额订单是否支持退款。

类型:boolean

查看示例

示例:false

data.refund_policy.redemption_supported 是

密钥开通固定不支持退款。

类型:boolean

查看取值约束
  • 固定值 false

示例:false

data.refund_policy.other_rules_apply 是

还需满足来源 API 应用、次数、安装量等退款规则;不是退款资格承诺。

类型:boolean

查看取值约束
  • 固定值 true

示例:true

data.statistics_state 是

available 已按统计权限返回,not_authorized 未授统计动作,disabled 账号未批准统计,unavailable 统计暂不可用或被限流。

类型:string

查看取值约束
  • 可选值 available / not_authorized / disabled / unavailable

示例:not_authorized

data.statistics 是

同时获统计动作与账号统计审批时返回现有统计结构;否则为 null,不能当作零。

类型:object | null

查看示例

示例:null

data.statistics.app_id 是

业务应用的完整 ID,来自列出应用或预留新应用的响应。

类型:string

查看取值约束
  • 格式 ^A[a-f0-9]{32}$
data.statistics.module 是

业务模块。enterprise 为企业签名,distribution 为普通应用分发。

类型:string

查看取值约束
  • 可选值 enterprise / distribution
  • enterprise — 企业签名
  • distribution — 普通应用分发
data.statistics.generated_at 是

本次结果的生成时间,Unix 秒。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.timezone 是

统计日期或预算周期采用的时区。

类型:string

查看取值约束
  • 固定值 Asia/Shanghai
data.statistics.record_scope 是

数据覆盖的留存范围。

类型:string

查看取值约束
  • 固定值 current_retained_counters
data.statistics.window 是

本次统计覆盖的日期和时间区间。

类型:object

data.statistics.window.start_date 是

区间首日,按响应中的 timezone 解释。

类型:string

查看取值约束
  • 格式 ^\d{4}-\d{2}-\d{2}$
data.statistics.window.end_date 是

区间末日,按响应中的 timezone 解释。

类型:string

查看取值约束
  • 格式 ^\d{4}-\d{2}-\d{2}$
data.statistics.window.start_at 是

时间区间起点,Unix 秒。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.window.end_at 是

时间区间边界,Unix 秒。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.downloads 是

平台已准入的下载计数。

类型:object

data.statistics.downloads.unit 是

此金额或计数的单位,结合所在对象解释。

类型:string

查看取值约束
  • 固定值 admitted_downloads
data.statistics.downloads.total 是

当前保留范围内的累计数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.downloads.today 是

统计时区内今日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.downloads.yesterday 是

统计时区内昨日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.downloads.last_7_days 是

近 7 个自然日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.downloads.last_30_days 是

近 30 个自然日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.installation_statistics_state 是

available 表示有数据,not_initialized 为未初始化,not_applicable 为此模块不适用。

类型:string

查看取值约束
  • 可选值 available / not_initialized / not_applicable
  • available — 计数可用
  • not_initialized — 尚未初始化
  • not_applicable — 此类应用不适用
data.statistics.installations 是

应用级安装设备统计。按返回口径跨版本去重,不能由各版本计数相加替代。

类型:object | null

data.statistics.installations.unit 是

此金额或计数的单位,结合所在对象解释。

类型:string

查看取值约束
  • 固定值 unique_admitted_device_fingerprints
data.statistics.installations.total 是

当前保留范围内的累计数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.installations.today 是

统计时区内今日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.installations.yesterday 是

统计时区内昨日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.installations.last_7_days 是

近 7 个自然日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.installations.last_30_days 是

近 30 个自然日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.installations.cross_version_deduplicated 是

是否已经跨版本按同一设备去重。

类型:boolean

查看取值约束
  • 固定值 true
data.statistics.launches 是

记录到的设备启动事件次数,按返回口径解释。

类型:object | null

data.statistics.launches.unit 是

此金额或计数的单位,结合所在对象解释。

类型:string

查看取值约束
  • 固定值 recorded_launch_events
data.statistics.launches.total 是

当前保留范围内的累计数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.launches.today 是

统计时区内今日的数量。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.launches.today_estimated 是

今日计数是否为历史兼容估计值。

类型:boolean

data.statistics.launches.current_rules_include_first_open 是

当前启动计数规则是否包含首次打开。

类型:boolean

查看取值约束
  • 固定值 true
data.statistics.launches.legacy_totals_may_exclude_first_open 是

旧版累计计数是否可能缺少首次打开。

类型:boolean

查看取值约束
  • 固定值 true
data.statistics.daily 是

本次统计窗口内的逐日计数,按返回的 timezone 解释日期。

类型:object[]

查看取值约束
  • 最少元素 30
  • 最多元素 30
data.statistics.daily[].date 是

本条统计对应的自然日。

类型:string

查看取值约束
  • 格式 ^\d{4}-\d{2}-\d{2}$
data.statistics.daily[].downloads 是

平台已准入的下载计数。

类型:integer

查看取值约束
  • 最小值 0
  • 最大值 9007199254740991
data.statistics.daily[].new_installations 是

该自然日新增的安装设备数。

类型:integer | null

查看取值约束
  • integer (最小值 0,最大值 9007199254740991)
data.signing_admission_rechecked 是

后续任务将重新检查期限、账号、应用、证书、源版本及并发/每日额度,当前详情不预留资格。

类型:boolean

查看取值约束
  • 固定值 true

示例:true

调用示例

请把示例中的应用 ID、资源 ID和业务数据替换为自己账号的真实返回值,再选择一种语言运行。安装、文件放置和 CLOUDSIGN_BASE_URL 等配置见SDK 使用说明。

下载示例依赖

Python 标准库示例使用 cloudsign_request.py;使用 SDK 时仅需准备所选语言。长期 Secret 保存在服务端,浏览器和移动端使用OAuth 授权。

有效套餐
HTTP 请求
GET /api/v1/apps/A11111111111111111111111111111111/signing-entitlement HTTP/1.1
Host: www.onesignios.com
Authorization: CS1-HMAC-SHA256 Credential=<AccessKey ID>,Signature=<签名>
X-Api-Date: <当前 UTC 时间>
X-Api-Nonce: <新生成的 32 位十六进制值>
X-Api-Content-Sha256: <正文摘要>
X-Api-Environment: production
Python 标准库调用
Python
from cloudsign_request import request

result = request(
    'GET',
    '/api/v1/apps/A11111111111111111111111111111111/signing-entitlement',
)
print(result["request_id"])
Python SDK 调用
Python SDK
import os
from cloudsign import Client

client = Client(
    "https://www.onesignios.com",
    os.environ["CLOUDSIGN_ACCESS_KEY_ID"],
    os.environ["CLOUDSIGN_ACCESS_KEY_SECRET"],
    os.environ.get("CLOUDSIGN_SECURITY_TOKEN", ""),
)

result = client.get_signing_entitlement(
    app='A11111111111111111111111111111111',
)
print(result["request_id"])
PHP SDK 调用
PHP SDK
<?php
declare(strict_types=1);

// Extract the PHP SDK source ZIP beside this file. Keep credentials on your server.
require_once __DIR__ . '/cloudsign-sdk/php/Client.php';
$requiredEnv = static function (string $name): string {
    $value = getenv($name);
    if ($value === false || $value === '') { throw new RuntimeException('Missing environment variable'); }
    return $value;
};
try {
    $client = new \Cloudsign\Sdk\Client(
        $requiredEnv('CLOUDSIGN_BASE_URL'),
        $requiredEnv('CLOUDSIGN_ACCESS_KEY_ID'),
        $requiredEnv('CLOUDSIGN_ACCESS_KEY_SECRET'),
        getenv('CLOUDSIGN_SECURITY_TOKEN') ?: '',
    );
    $result = $client->getSigningEntitlement(
        'A11111111111111111111111111111111'
    );
    echo $result['request_id'], PHP_EOL;
} catch (\Cloudsign\Sdk\ApiError $error) {
    fwrite(STDERR, 'HTTP ' . $error->status . ' ' . $error->apiCode . '; RequestId: ' . $error->requestId . PHP_EOL);
    exit(1);
} catch (Throwable $error) {
    fwrite(STDERR, "Check SDK path, runtime and environment variables.\n");
    exit(1);
}
Node.js SDK 调用
Node.js SDK
// Node.js 20+ on a trusted server. Do not bundle this SDK in browsers or Vue.
import { ApiError, Client } from './cloudsign-sdk/node/client.mjs';

const requiredEnv = name => {
    const value = process.env[name];
    if (!value) throw new Error('Missing environment variable');
    return value;
};
try {
    const client = new Client(
        requiredEnv('CLOUDSIGN_BASE_URL'),
        requiredEnv('CLOUDSIGN_ACCESS_KEY_ID'),
        requiredEnv('CLOUDSIGN_ACCESS_KEY_SECRET'),
        process.env.CLOUDSIGN_SECURITY_TOKEN || '',
    );
    const result = await client.getSigningEntitlement(
        "A11111111111111111111111111111111"
    );
    console.log(result.request_id);
} catch (error) {
    if (error instanceof ApiError) console.error(`HTTP ${error.status} ${error.code}; RequestId: ${error.requestId}`);
    else console.error('Check SDK path, runtime and environment variables.');
    process.exitCode = 1;
}
Go SDK 调用
Go SDK
// Go 1.22+, trusted server. Extract the Go SDK ZIP beside example.go.
package main

import (
    "context"
    "errors"
    "fmt"
    "os"
    "time"

    cloudsign "cloudsign/sdk"
)

func main() {
    fail := func(err error) {
        var api *cloudsign.APIError
        if errors.As(err, &api) {
            fmt.Fprintf(os.Stderr, "HTTP %d %s; RequestId: %s\n", api.Status, api.Code, api.RequestID)
        } else {
            fmt.Fprintln(os.Stderr, "Check SDK path, runtime and environment variables.")
        }
        os.Exit(1)
    }
    client, err := cloudsign.New(
        os.Getenv("CLOUDSIGN_BASE_URL"),
        os.Getenv("CLOUDSIGN_ACCESS_KEY_ID"),
        os.Getenv("CLOUDSIGN_ACCESS_KEY_SECRET"),
        os.Getenv("CLOUDSIGN_SECURITY_TOKEN"),
    )
    if err != nil { fail(err); return }
    ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
    defer cancel()
    result, err := client.GetSigningEntitlement(
		ctx,
		"A11111111111111111111111111111111",
	)
    if err != nil { fail(err); return }
    fmt.Println(result.RequestID)
}
Java SDK 调用
Java SDK
// Java 17+, server-side. Extract the Java SDK ZIP beside Example.java.
import com.cloudsign.openapi.Client;
import java.util.*;

public class Example {
    private static String env(String name) {
        String value = System.getenv(name);
        if (value == null || value.isEmpty()) throw new IllegalArgumentException("Missing environment variable");
        return value;
    }
    private static Map<String,Object> object(Object... pairs) {
        var result = new LinkedHashMap<String,Object>();
        for (int i = 0; i < pairs.length; i += 2) result.put((String)pairs[i], pairs[i+1]);
        return result;
    }
    public static void main(String[] args) {
        try {
            var client = new Client(
                env("CLOUDSIGN_BASE_URL"),
                env("CLOUDSIGN_ACCESS_KEY_ID"),
                env("CLOUDSIGN_ACCESS_KEY_SECRET"),
                System.getenv().getOrDefault("CLOUDSIGN_SECURITY_TOKEN", "")
            );
            var result = client.getSigningEntitlement(
                "A11111111111111111111111111111111"
            );
            System.out.println(result.requestId());
        } catch (Client.ApiException error) {
            System.err.printf("HTTP %d %s; RequestId: %s%n", error.status, error.code, error.requestId);
            System.exit(1);
        } catch (Exception error) {
            if (error instanceof InterruptedException) Thread.currentThread().interrupt();
            System.err.println("Check SDK path, runtime and environment variables.");
            System.exit(1);
        }
    }
}
Rust SDK 调用
Rust SDK
// Rust 1.88+, trusted server. Save as cloudsign-sdk/rust/examples/example.rs.
use cloudsign_openapi::{Client, Credentials, GetSigningEntitlement};
use serde_json::json;
use std::{env, error::Error};

async fn run() -> Result<(), Box<dyn Error>> {
    let origin = env::var("CLOUDSIGN_BASE_URL")?;
    let credentials = Credentials::new(
        env::var("CLOUDSIGN_ACCESS_KEY_ID")?,
        env::var("CLOUDSIGN_ACCESS_KEY_SECRET")?,
        env::var("CLOUDSIGN_SECURITY_TOKEN").ok().filter(|v| !v.is_empty()),
        None,
    )?;
    let client = Client::new(&origin, credentials)?;
    let input: GetSigningEntitlement = serde_json::from_value(json!({
        "app_id": "A11111111111111111111111111111111"
    }))?;
    let result = client.get_signing_entitlement(&input).await?;
    println!("{}", result.request_id);
    Ok(())
}

#[tokio::main]
async fn main() {
    if let Err(error) = run().await {
        if let Some(api) = error.downcast_ref::<cloudsign_openapi::Error>() {
            eprintln!("HTTP {} {}; RequestId: {}", api.status, api.code, api.request_id.as_deref().unwrap_or(""));
        } else {
            eprintln!("Check SDK path, runtime, environment variables and business input.");
        }
        std::process::exit(1);
    }
}
C SDK 调用

请求对象和响应对象的使用方式见C SDK 请求与响应。

C SDK
/* C11, trusted server. Save as example.c in the source ZIP root. */
#include <cloudsign/openapi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static int copy_env(char *out, size_t capacity, const char *name, int required) {
    const char *value = getenv(name);
    if (!value || !*value) return !required;
    size_t length = strlen(value);
    if (length >= capacity) return 0;
    memcpy(out, value, length + 1);
    return 1;
}

int main(void) {
    cloudsign_credentials credentials = {0};
    cloudsign_client *client = NULL;
    cloudsign_result *result = NULL;
    cloudsign_decoded_response *decoded = NULL;
    cloudsign_built_request *built = NULL;
    cloudsign_status status = CLOUDSIGN_INVALID_CONFIGURATION;
    int initialized = 0, exit_code = 1;
    const char *origin = getenv("CLOUDSIGN_BASE_URL");
    if (!origin || !copy_env(credentials.access_key_id, sizeof(credentials.access_key_id), "CLOUDSIGN_ACCESS_KEY_ID", 1)
        || !copy_env(credentials.access_key_secret, sizeof(credentials.access_key_secret), "CLOUDSIGN_ACCESS_KEY_SECRET", 1)
        || !copy_env(credentials.security_token, sizeof(credentials.security_token), "CLOUDSIGN_SECURITY_TOKEN", 0)) goto done;
    status = cloudsign_global_init();
    if (status != CLOUDSIGN_OK) goto done;
    initialized = 1;
    cloudsign_options options = {.origin = origin, .credentials = &credentials, .timeout_ms = 15000};
    status = cloudsign_client_create(&options, &client);
    cloudsign_credentials_clear(&credentials);
    if (status != CLOUDSIGN_OK) goto done;
    const cloudsign_input_get_signing_entitlement input = {.presence_app_id = CLOUDSIGN_FIELD_VALUE, .app_id = "A11111111111111111111111111111111"};
    status = cloudsign_build_get_signing_entitlement(&input, &built);
    if (status != CLOUDSIGN_OK) goto done;
    status = cloudsign_send_built_request(client, built, &result);
    if (status == CLOUDSIGN_OK) {
        status = cloudsign_decode_get_signing_entitlement(result, &decoded);
        if (status != CLOUDSIGN_OK) goto done;
        const cloudsign_model_signing_entitlement *data = cloudsign_response_get_signing_entitlement(decoded);
        if (!data) { status = CLOUDSIGN_INVALID_RESPONSE; goto done; }
        /* Read typed fields here; NULL/absent is distinct from zero/false. */
        (void)data;
        puts(cloudsign_decoded_request_id(decoded));
        exit_code = 0;
    }
done:
    if (exit_code) {
        if (status == CLOUDSIGN_API_ERROR) fprintf(stderr, "HTTP %ld %s; RequestId: %s\n", cloudsign_result_http_status(result), cloudsign_result_error_code(result), cloudsign_result_request_id(result));
        else fputs("Check SDK path, runtime, environment variables and business input.\n", stderr);
    }
    cloudsign_result_free(result);
    cloudsign_decoded_free(decoded);
    cloudsign_built_request_free(built);
    cloudsign_client_free(client);
    if (initialized) cloudsign_global_cleanup();
    cloudsign_credentials_clear(&credentials);
    return exit_code;
}
JSON 响应
{
    "request_id": "00000000000000000000000000000000",
    "data": {
        "app_id": "A11111111111111111111111111111111",
        "generated_at": 1793937600,
        "state": "active",
        "plan_id": 2,
        "plan_name": "高级版",
        "sign_expires_at": 1796529600,
        "remaining_seconds": 2592000,
        "first_recorded_activation_at": 1793937600,
        "application_status": "normal",
        "certificate": {
            "id": "C77777777777777777777777777777777",
            "label": "R2",
            "team": "Fixture Team",
            "certificate_expires": "2027-12-31",
            "profile_expires": "2027-12-31",
            "selected": true
        },
        "certificate_state": "assigned",
        "installation_limit": {
            "maximum_devices": 1000,
            "unlimited": false,
            "cross_version_deduplicated": true
        },
        "verification": {
            "injection_enabled": true,
            "ui_mode": 3,
            "ui_inherited": true,
            "applies_to_next_signature": true
        },
        "refund_policy": {
            "window_seconds": 86400,
            "daily_supported": false,
            "redemption_supported": false,
            "other_rules_apply": true
        },
        "statistics_state": "not_authorized",
        "statistics": null,
        "signing_admission_rechecked": true
    }
}
尚未开通
HTTP 请求
GET /api/v1/apps/A11111111111111111111111111111111/signing-entitlement HTTP/1.1
Host: www.onesignios.com
Authorization: CS1-HMAC-SHA256 Credential=<AccessKey ID>,Signature=<签名>
X-Api-Date: <当前 UTC 时间>
X-Api-Nonce: <新生成的 32 位十六进制值>
X-Api-Content-Sha256: <正文摘要>
X-Api-Environment: production
Python 标准库调用
Python
from cloudsign_request import request

result = request(
    'GET',
    '/api/v1/apps/A11111111111111111111111111111111/signing-entitlement',
)
print(result["request_id"])
Python SDK 调用
Python SDK
import os
from cloudsign import Client

client = Client(
    "https://www.onesignios.com",
    os.environ["CLOUDSIGN_ACCESS_KEY_ID"],
    os.environ["CLOUDSIGN_ACCESS_KEY_SECRET"],
    os.environ.get("CLOUDSIGN_SECURITY_TOKEN", ""),
)

result = client.get_signing_entitlement(
    app='A11111111111111111111111111111111',
)
print(result["request_id"])
PHP SDK 调用
PHP SDK
<?php
declare(strict_types=1);

// Extract the PHP SDK source ZIP beside this file. Keep credentials on your server.
require_once __DIR__ . '/cloudsign-sdk/php/Client.php';
$requiredEnv = static function (string $name): string {
    $value = getenv($name);
    if ($value === false || $value === '') { throw new RuntimeException('Missing environment variable'); }
    return $value;
};
try {
    $client = new \Cloudsign\Sdk\Client(
        $requiredEnv('CLOUDSIGN_BASE_URL'),
        $requiredEnv('CLOUDSIGN_ACCESS_KEY_ID'),
        $requiredEnv('CLOUDSIGN_ACCESS_KEY_SECRET'),
        getenv('CLOUDSIGN_SECURITY_TOKEN') ?: '',
    );
    $result = $client->getSigningEntitlement(
        'A11111111111111111111111111111111'
    );
    echo $result['request_id'], PHP_EOL;
} catch (\Cloudsign\Sdk\ApiError $error) {
    fwrite(STDERR, 'HTTP ' . $error->status . ' ' . $error->apiCode . '; RequestId: ' . $error->requestId . PHP_EOL);
    exit(1);
} catch (Throwable $error) {
    fwrite(STDERR, "Check SDK path, runtime and environment variables.\n");
    exit(1);
}
Node.js SDK 调用
Node.js SDK
// Node.js 20+ on a trusted server. Do not bundle this SDK in browsers or Vue.
import { ApiError, Client } from './cloudsign-sdk/node/client.mjs';

const requiredEnv = name => {
    const value = process.env[name];
    if (!value) throw new Error('Missing environment variable');
    return value;
};
try {
    const client = new Client(
        requiredEnv('CLOUDSIGN_BASE_URL'),
        requiredEnv('CLOUDSIGN_ACCESS_KEY_ID'),
        requiredEnv('CLOUDSIGN_ACCESS_KEY_SECRET'),
        process.env.CLOUDSIGN_SECURITY_TOKEN || '',
    );
    const result = await client.getSigningEntitlement(
        "A11111111111111111111111111111111"
    );
    console.log(result.request_id);
} catch (error) {
    if (error instanceof ApiError) console.error(`HTTP ${error.status} ${error.code}; RequestId: ${error.requestId}`);
    else console.error('Check SDK path, runtime and environment variables.');
    process.exitCode = 1;
}
Go SDK 调用
Go SDK
// Go 1.22+, trusted server. Extract the Go SDK ZIP beside example.go.
package main

import (
    "context"
    "errors"
    "fmt"
    "os"
    "time"

    cloudsign "cloudsign/sdk"
)

func main() {
    fail := func(err error) {
        var api *cloudsign.APIError
        if errors.As(err, &api) {
            fmt.Fprintf(os.Stderr, "HTTP %d %s; RequestId: %s\n", api.Status, api.Code, api.RequestID)
        } else {
            fmt.Fprintln(os.Stderr, "Check SDK path, runtime and environment variables.")
        }
        os.Exit(1)
    }
    client, err := cloudsign.New(
        os.Getenv("CLOUDSIGN_BASE_URL"),
        os.Getenv("CLOUDSIGN_ACCESS_KEY_ID"),
        os.Getenv("CLOUDSIGN_ACCESS_KEY_SECRET"),
        os.Getenv("CLOUDSIGN_SECURITY_TOKEN"),
    )
    if err != nil { fail(err); return }
    ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
    defer cancel()
    result, err := client.GetSigningEntitlement(
		ctx,
		"A11111111111111111111111111111111",
	)
    if err != nil { fail(err); return }
    fmt.Println(result.RequestID)
}
Java SDK 调用
Java SDK
// Java 17+, server-side. Extract the Java SDK ZIP beside Example.java.
import com.cloudsign.openapi.Client;
import java.util.*;

public class Example {
    private static String env(String name) {
        String value = System.getenv(name);
        if (value == null || value.isEmpty()) throw new IllegalArgumentException("Missing environment variable");
        return value;
    }
    private static Map<String,Object> object(Object... pairs) {
        var result = new LinkedHashMap<String,Object>();
        for (int i = 0; i < pairs.length; i += 2) result.put((String)pairs[i], pairs[i+1]);
        return result;
    }
    public static void main(String[] args) {
        try {
            var client = new Client(
                env("CLOUDSIGN_BASE_URL"),
                env("CLOUDSIGN_ACCESS_KEY_ID"),
                env("CLOUDSIGN_ACCESS_KEY_SECRET"),
                System.getenv().getOrDefault("CLOUDSIGN_SECURITY_TOKEN", "")
            );
            var result = client.getSigningEntitlement(
                "A11111111111111111111111111111111"
            );
            System.out.println(result.requestId());
        } catch (Client.ApiException error) {
            System.err.printf("HTTP %d %s; RequestId: %s%n", error.status, error.code, error.requestId);
            System.exit(1);
        } catch (Exception error) {
            if (error instanceof InterruptedException) Thread.currentThread().interrupt();
            System.err.println("Check SDK path, runtime and environment variables.");
            System.exit(1);
        }
    }
}
Rust SDK 调用
Rust SDK
// Rust 1.88+, trusted server. Save as cloudsign-sdk/rust/examples/example.rs.
use cloudsign_openapi::{Client, Credentials, GetSigningEntitlement};
use serde_json::json;
use std::{env, error::Error};

async fn run() -> Result<(), Box<dyn Error>> {
    let origin = env::var("CLOUDSIGN_BASE_URL")?;
    let credentials = Credentials::new(
        env::var("CLOUDSIGN_ACCESS_KEY_ID")?,
        env::var("CLOUDSIGN_ACCESS_KEY_SECRET")?,
        env::var("CLOUDSIGN_SECURITY_TOKEN").ok().filter(|v| !v.is_empty()),
        None,
    )?;
    let client = Client::new(&origin, credentials)?;
    let input: GetSigningEntitlement = serde_json::from_value(json!({
        "app_id": "A11111111111111111111111111111111"
    }))?;
    let result = client.get_signing_entitlement(&input).await?;
    println!("{}", result.request_id);
    Ok(())
}

#[tokio::main]
async fn main() {
    if let Err(error) = run().await {
        if let Some(api) = error.downcast_ref::<cloudsign_openapi::Error>() {
            eprintln!("HTTP {} {}; RequestId: {}", api.status, api.code, api.request_id.as_deref().unwrap_or(""));
        } else {
            eprintln!("Check SDK path, runtime, environment variables and business input.");
        }
        std::process::exit(1);
    }
}
C SDK 调用

请求对象和响应对象的使用方式见C SDK 请求与响应。

C SDK
/* C11, trusted server. Save as example.c in the source ZIP root. */
#include <cloudsign/openapi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static int copy_env(char *out, size_t capacity, const char *name, int required) {
    const char *value = getenv(name);
    if (!value || !*value) return !required;
    size_t length = strlen(value);
    if (length >= capacity) return 0;
    memcpy(out, value, length + 1);
    return 1;
}

int main(void) {
    cloudsign_credentials credentials = {0};
    cloudsign_client *client = NULL;
    cloudsign_result *result = NULL;
    cloudsign_decoded_response *decoded = NULL;
    cloudsign_built_request *built = NULL;
    cloudsign_status status = CLOUDSIGN_INVALID_CONFIGURATION;
    int initialized = 0, exit_code = 1;
    const char *origin = getenv("CLOUDSIGN_BASE_URL");
    if (!origin || !copy_env(credentials.access_key_id, sizeof(credentials.access_key_id), "CLOUDSIGN_ACCESS_KEY_ID", 1)
        || !copy_env(credentials.access_key_secret, sizeof(credentials.access_key_secret), "CLOUDSIGN_ACCESS_KEY_SECRET", 1)
        || !copy_env(credentials.security_token, sizeof(credentials.security_token), "CLOUDSIGN_SECURITY_TOKEN", 0)) goto done;
    status = cloudsign_global_init();
    if (status != CLOUDSIGN_OK) goto done;
    initialized = 1;
    cloudsign_options options = {.origin = origin, .credentials = &credentials, .timeout_ms = 15000};
    status = cloudsign_client_create(&options, &client);
    cloudsign_credentials_clear(&credentials);
    if (status != CLOUDSIGN_OK) goto done;
    const cloudsign_input_get_signing_entitlement input = {.presence_app_id = CLOUDSIGN_FIELD_VALUE, .app_id = "A11111111111111111111111111111111"};
    status = cloudsign_build_get_signing_entitlement(&input, &built);
    if (status != CLOUDSIGN_OK) goto done;
    status = cloudsign_send_built_request(client, built, &result);
    if (status == CLOUDSIGN_OK) {
        status = cloudsign_decode_get_signing_entitlement(result, &decoded);
        if (status != CLOUDSIGN_OK) goto done;
        const cloudsign_model_signing_entitlement *data = cloudsign_response_get_signing_entitlement(decoded);
        if (!data) { status = CLOUDSIGN_INVALID_RESPONSE; goto done; }
        /* Read typed fields here; NULL/absent is distinct from zero/false. */
        (void)data;
        puts(cloudsign_decoded_request_id(decoded));
        exit_code = 0;
    }
done:
    if (exit_code) {
        if (status == CLOUDSIGN_API_ERROR) fprintf(stderr, "HTTP %ld %s; RequestId: %s\n", cloudsign_result_http_status(result), cloudsign_result_error_code(result), cloudsign_result_request_id(result));
        else fputs("Check SDK path, runtime, environment variables and business input.\n", stderr);
    }
    cloudsign_result_free(result);
    cloudsign_decoded_free(decoded);
    cloudsign_built_request_free(built);
    cloudsign_client_free(client);
    if (initialized) cloudsign_global_cleanup();
    cloudsign_credentials_clear(&credentials);
    return exit_code;
}
JSON 响应
{
    "request_id": "00000000000000000000000000000000",
    "data": {
        "app_id": "A11111111111111111111111111111111",
        "generated_at": 1793937600,
        "state": "not_activated",
        "plan_id": 0,
        "plan_name": "未分类",
        "sign_expires_at": 0,
        "remaining_seconds": 0,
        "first_recorded_activation_at": null,
        "application_status": "normal",
        "certificate": null,
        "certificate_state": "unavailable",
        "installation_limit": {
            "maximum_devices": 1000,
            "unlimited": false,
            "cross_version_deduplicated": true
        },
        "verification": {
            "injection_enabled": true,
            "ui_mode": 3,
            "ui_inherited": true,
            "applies_to_next_signature": true
        },
        "refund_policy": {
            "window_seconds": 86400,
            "daily_supported": false,
            "redemption_supported": false,
            "other_rules_apply": true
        },
        "statistics_state": "not_authorized",
        "statistics": null,
        "signing_admission_rechecked": true
    }
}
已到期与独立统计
HTTP 请求
GET /api/v1/apps/A11111111111111111111111111111111/signing-entitlement HTTP/1.1
Host: www.onesignios.com
Authorization: CS1-HMAC-SHA256 Credential=<AccessKey ID>,Signature=<签名>
X-Api-Date: <当前 UTC 时间>
X-Api-Nonce: <新生成的 32 位十六进制值>
X-Api-Content-Sha256: <正文摘要>
X-Api-Environment: production
Python 标准库调用
Python
from cloudsign_request import request

result = request(
    'GET',
    '/api/v1/apps/A11111111111111111111111111111111/signing-entitlement',
)
print(result["request_id"])
Python SDK 调用
Python SDK
import os
from cloudsign import Client

client = Client(
    "https://www.onesignios.com",
    os.environ["CLOUDSIGN_ACCESS_KEY_ID"],
    os.environ["CLOUDSIGN_ACCESS_KEY_SECRET"],
    os.environ.get("CLOUDSIGN_SECURITY_TOKEN", ""),
)

result = client.get_signing_entitlement(
    app='A11111111111111111111111111111111',
)
print(result["request_id"])
PHP SDK 调用
PHP SDK
<?php
declare(strict_types=1);

// Extract the PHP SDK source ZIP beside this file. Keep credentials on your server.
require_once __DIR__ . '/cloudsign-sdk/php/Client.php';
$requiredEnv = static function (string $name): string {
    $value = getenv($name);
    if ($value === false || $value === '') { throw new RuntimeException('Missing environment variable'); }
    return $value;
};
try {
    $client = new \Cloudsign\Sdk\Client(
        $requiredEnv('CLOUDSIGN_BASE_URL'),
        $requiredEnv('CLOUDSIGN_ACCESS_KEY_ID'),
        $requiredEnv('CLOUDSIGN_ACCESS_KEY_SECRET'),
        getenv('CLOUDSIGN_SECURITY_TOKEN') ?: '',
    );
    $result = $client->getSigningEntitlement(
        'A11111111111111111111111111111111'
    );
    echo $result['request_id'], PHP_EOL;
} catch (\Cloudsign\Sdk\ApiError $error) {
    fwrite(STDERR, 'HTTP ' . $error->status . ' ' . $error->apiCode . '; RequestId: ' . $error->requestId . PHP_EOL);
    exit(1);
} catch (Throwable $error) {
    fwrite(STDERR, "Check SDK path, runtime and environment variables.\n");
    exit(1);
}
Node.js SDK 调用
Node.js SDK
// Node.js 20+ on a trusted server. Do not bundle this SDK in browsers or Vue.
import { ApiError, Client } from './cloudsign-sdk/node/client.mjs';

const requiredEnv = name => {
    const value = process.env[name];
    if (!value) throw new Error('Missing environment variable');
    return value;
};
try {
    const client = new Client(
        requiredEnv('CLOUDSIGN_BASE_URL'),
        requiredEnv('CLOUDSIGN_ACCESS_KEY_ID'),
        requiredEnv('CLOUDSIGN_ACCESS_KEY_SECRET'),
        process.env.CLOUDSIGN_SECURITY_TOKEN || '',
    );
    const result = await client.getSigningEntitlement(
        "A11111111111111111111111111111111"
    );
    console.log(result.request_id);
} catch (error) {
    if (error instanceof ApiError) console.error(`HTTP ${error.status} ${error.code}; RequestId: ${error.requestId}`);
    else console.error('Check SDK path, runtime and environment variables.');
    process.exitCode = 1;
}
Go SDK 调用
Go SDK
// Go 1.22+, trusted server. Extract the Go SDK ZIP beside example.go.
package main

import (
    "context"
    "errors"
    "fmt"
    "os"
    "time"

    cloudsign "cloudsign/sdk"
)

func main() {
    fail := func(err error) {
        var api *cloudsign.APIError
        if errors.As(err, &api) {
            fmt.Fprintf(os.Stderr, "HTTP %d %s; RequestId: %s\n", api.Status, api.Code, api.RequestID)
        } else {
            fmt.Fprintln(os.Stderr, "Check SDK path, runtime and environment variables.")
        }
        os.Exit(1)
    }
    client, err := cloudsign.New(
        os.Getenv("CLOUDSIGN_BASE_URL"),
        os.Getenv("CLOUDSIGN_ACCESS_KEY_ID"),
        os.Getenv("CLOUDSIGN_ACCESS_KEY_SECRET"),
        os.Getenv("CLOUDSIGN_SECURITY_TOKEN"),
    )
    if err != nil { fail(err); return }
    ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
    defer cancel()
    result, err := client.GetSigningEntitlement(
		ctx,
		"A11111111111111111111111111111111",
	)
    if err != nil { fail(err); return }
    fmt.Println(result.RequestID)
}
Java SDK 调用
Java SDK
// Java 17+, server-side. Extract the Java SDK ZIP beside Example.java.
import com.cloudsign.openapi.Client;
import java.util.*;

public class Example {
    private static String env(String name) {
        String value = System.getenv(name);
        if (value == null || value.isEmpty()) throw new IllegalArgumentException("Missing environment variable");
        return value;
    }
    private static Map<String,Object> object(Object... pairs) {
        var result = new LinkedHashMap<String,Object>();
        for (int i = 0; i < pairs.length; i += 2) result.put((String)pairs[i], pairs[i+1]);
        return result;
    }
    public static void main(String[] args) {
        try {
            var client = new Client(
                env("CLOUDSIGN_BASE_URL"),
                env("CLOUDSIGN_ACCESS_KEY_ID"),
                env("CLOUDSIGN_ACCESS_KEY_SECRET"),
                System.getenv().getOrDefault("CLOUDSIGN_SECURITY_TOKEN", "")
            );
            var result = client.getSigningEntitlement(
                "A11111111111111111111111111111111"
            );
            System.out.println(result.requestId());
        } catch (Client.ApiException error) {
            System.err.printf("HTTP %d %s; RequestId: %s%n", error.status, error.code, error.requestId);
            System.exit(1);
        } catch (Exception error) {
            if (error instanceof InterruptedException) Thread.currentThread().interrupt();
            System.err.println("Check SDK path, runtime and environment variables.");
            System.exit(1);
        }
    }
}
Rust SDK 调用
Rust SDK
// Rust 1.88+, trusted server. Save as cloudsign-sdk/rust/examples/example.rs.
use cloudsign_openapi::{Client, Credentials, GetSigningEntitlement};
use serde_json::json;
use std::{env, error::Error};

async fn run() -> Result<(), Box<dyn Error>> {
    let origin = env::var("CLOUDSIGN_BASE_URL")?;
    let credentials = Credentials::new(
        env::var("CLOUDSIGN_ACCESS_KEY_ID")?,
        env::var("CLOUDSIGN_ACCESS_KEY_SECRET")?,
        env::var("CLOUDSIGN_SECURITY_TOKEN").ok().filter(|v| !v.is_empty()),
        None,
    )?;
    let client = Client::new(&origin, credentials)?;
    let input: GetSigningEntitlement = serde_json::from_value(json!({
        "app_id": "A11111111111111111111111111111111"
    }))?;
    let result = client.get_signing_entitlement(&input).await?;
    println!("{}", result.request_id);
    Ok(())
}

#[tokio::main]
async fn main() {
    if let Err(error) = run().await {
        if let Some(api) = error.downcast_ref::<cloudsign_openapi::Error>() {
            eprintln!("HTTP {} {}; RequestId: {}", api.status, api.code, api.request_id.as_deref().unwrap_or(""));
        } else {
            eprintln!("Check SDK path, runtime, environment variables and business input.");
        }
        std::process::exit(1);
    }
}
C SDK 调用

请求对象和响应对象的使用方式见C SDK 请求与响应。

C SDK
/* C11, trusted server. Save as example.c in the source ZIP root. */
#include <cloudsign/openapi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static int copy_env(char *out, size_t capacity, const char *name, int required) {
    const char *value = getenv(name);
    if (!value || !*value) return !required;
    size_t length = strlen(value);
    if (length >= capacity) return 0;
    memcpy(out, value, length + 1);
    return 1;
}

int main(void) {
    cloudsign_credentials credentials = {0};
    cloudsign_client *client = NULL;
    cloudsign_result *result = NULL;
    cloudsign_decoded_response *decoded = NULL;
    cloudsign_built_request *built = NULL;
    cloudsign_status status = CLOUDSIGN_INVALID_CONFIGURATION;
    int initialized = 0, exit_code = 1;
    const char *origin = getenv("CLOUDSIGN_BASE_URL");
    if (!origin || !copy_env(credentials.access_key_id, sizeof(credentials.access_key_id), "CLOUDSIGN_ACCESS_KEY_ID", 1)
        || !copy_env(credentials.access_key_secret, sizeof(credentials.access_key_secret), "CLOUDSIGN_ACCESS_KEY_SECRET", 1)
        || !copy_env(credentials.security_token, sizeof(credentials.security_token), "CLOUDSIGN_SECURITY_TOKEN", 0)) goto done;
    status = cloudsign_global_init();
    if (status != CLOUDSIGN_OK) goto done;
    initialized = 1;
    cloudsign_options options = {.origin = origin, .credentials = &credentials, .timeout_ms = 15000};
    status = cloudsign_client_create(&options, &client);
    cloudsign_credentials_clear(&credentials);
    if (status != CLOUDSIGN_OK) goto done;
    const cloudsign_input_get_signing_entitlement input = {.presence_app_id = CLOUDSIGN_FIELD_VALUE, .app_id = "A11111111111111111111111111111111"};
    status = cloudsign_build_get_signing_entitlement(&input, &built);
    if (status != CLOUDSIGN_OK) goto done;
    status = cloudsign_send_built_request(client, built, &result);
    if (status == CLOUDSIGN_OK) {
        status = cloudsign_decode_get_signing_entitlement(result, &decoded);
        if (status != CLOUDSIGN_OK) goto done;
        const cloudsign_model_signing_entitlement *data = cloudsign_response_get_signing_entitlement(decoded);
        if (!data) { status = CLOUDSIGN_INVALID_RESPONSE; goto done; }
        /* Read typed fields here; NULL/absent is distinct from zero/false. */
        (void)data;
        puts(cloudsign_decoded_request_id(decoded));
        exit_code = 0;
    }
done:
    if (exit_code) {
        if (status == CLOUDSIGN_API_ERROR) fprintf(stderr, "HTTP %ld %s; RequestId: %s\n", cloudsign_result_http_status(result), cloudsign_result_error_code(result), cloudsign_result_request_id(result));
        else fputs("Check SDK path, runtime, environment variables and business input.\n", stderr);
    }
    cloudsign_result_free(result);
    cloudsign_decoded_free(decoded);
    cloudsign_built_request_free(built);
    cloudsign_client_free(client);
    if (initialized) cloudsign_global_cleanup();
    cloudsign_credentials_clear(&credentials);
    return exit_code;
}
JSON 响应
{
    "request_id": "00000000000000000000000000000000",
    "data": {
        "app_id": "A11111111111111111111111111111111",
        "generated_at": 1793937600,
        "state": "expired",
        "plan_id": 2,
        "plan_name": "高级版",
        "sign_expires_at": 1793851200,
        "remaining_seconds": 0,
        "first_recorded_activation_at": 1793937600,
        "application_status": "blocked",
        "certificate": {
            "id": "C77777777777777777777777777777777",
            "label": "R2",
            "team": "Fixture Team",
            "certificate_expires": "2027-12-31",
            "profile_expires": "2027-12-31",
            "selected": true
        },
        "certificate_state": "assigned",
        "installation_limit": {
            "maximum_devices": 1000,
            "unlimited": false,
            "cross_version_deduplicated": true
        },
        "verification": {
            "injection_enabled": true,
            "ui_mode": 3,
            "ui_inherited": true,
            "applies_to_next_signature": true
        },
        "refund_policy": {
            "window_seconds": 86400,
            "daily_supported": false,
            "redemption_supported": false,
            "other_rules_apply": true
        },
        "statistics_state": "available",
        "statistics": {
            "app_id": "A11111111111111111111111111111111",
            "module": "enterprise",
            "generated_at": 1794150000,
            "timezone": "Asia/Shanghai",
            "record_scope": "current_retained_counters",
            "window": {
                "start_date": "2026-10-10",
                "end_date": "2026-11-08",
                "start_at": 1791561600,
                "end_at": 1794153600
            },
            "downloads": {
                "unit": "admitted_downloads",
                "total": 6,
                "today": 1,
                "yesterday": 0,
                "last_7_days": 1,
                "last_30_days": 1
            },
            "installation_statistics_state": "available",
            "installations": {
                "unit": "unique_admitted_device_fingerprints",
                "total": 2,
                "today": 1,
                "yesterday": 0,
                "last_7_days": 1,
                "last_30_days": 1,
                "cross_version_deduplicated": true
            },
            "launches": {
                "unit": "recorded_launch_events",
                "total": 4,
                "today": 1,
                "today_estimated": true,
                "current_rules_include_first_open": true,
                "legacy_totals_may_exclude_first_open": true
            },
            "daily": [
                {
                    "date": "2026-10-10",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-11",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-12",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-13",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-14",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-15",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-16",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-17",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-18",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-19",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-20",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-21",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-22",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-23",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-24",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-25",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-26",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-27",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-28",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-29",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-30",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-10-31",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-11-01",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-11-02",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-11-03",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-11-04",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-11-05",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-11-06",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-11-07",
                    "downloads": 0,
                    "new_installations": 0
                },
                {
                    "date": "2026-11-08",
                    "downloads": 1,
                    "new_installations": 1
                }
            ]
        },
        "signing_admission_rechecked": true
    }
}

错误处理

失败或中断后

依赖数据暂不可用时保留原记录稍后查询,不把空值显示成无限权益或零安装量。实际签名、付款和退款都会重新检查业务条件。

相关错误码

HTTP错误码处理方式
404NotFound核对路径中各标识是否完整、属于同一业务应用且在当前授权范围内。
403AccessDenied检查当前身份的动作、资源范围、来源 IP 及功能准入。
400InvalidQuery检查参数名称、格式、范围和 URI 编码,删除重复参数。
503EntitlementsUnavailable签名权益、证书或站点配置暂不可用。保存 request_id,稍后查询原应用。
401InvalidCredentials凭据无效、已停用,或请求签名不匹配。核对 AK、环境、正文摘要和签名头。
429Throttled请求达到限额,按 Retry-After 返回的秒数等待,再以新 nonce 发起请求。
公共错误、重试与幂等说明 →