调用GetWebHostingUploadCredential获取静态网站托管的上传文件凭证。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String GetWebHostingUploadCredential

系统规定参数。取值:GetWebHostingUploadCredential。

FilePath String /

文件路径。

SpaceId String 0e16bb12-14af-4635-b24c-5ac1a9a*****

服务空间ID。

返回数据

名称 类型 示例值 描述
Code String success

请求返回状态。

  • success:成功。
  • failed:失败。
Data Struct

返回数据。

AccessKeyId String STS.NUcPHyHQr2xQ6zAe5ybi*****

文件上传临时凭证的AccessKeyId。

BucketName String fbpsbvmo-154159039388***-static

上传的bucket名称。

Endpoint String fbpsbvmo-154159039388***-static.oss-cn-zhangjiakou.aliyuncs.com

上传文件的目标地址。

ExpiredTime Long 1590460358

过期时间的时间戳。

FilePath String /

文件路径。

Policy String eyJleHBpcmF0aW9uIjoiMjAyMC0wNS0yNlQwNjozMjoxOC43NTZaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsNTI0Mjg4MDBdLHsia2V5IjoiMGUxNmJiMTItMTRhZi00NjM1LWIyNGMtNWFjMWE5YTdiYjlmL2Zvcm1hdC5qc29uIn1dfQ==

请求表单域的合法性校验策略。

SecurityToken String CAISgQJ1q6Ft5B2yfSjIr5bWG%2FLNpY5Thbq6NFzwgTUsbuZ4grfe0Tz2IHBEeXRuA%2B0WsvQ%2Bnm9X6vgelqFZYqRoYGHiUZOjKEbIPUXzDbDasumZsJYm6vT8a0XxZjf%2F2MjNGZabKPrWZvaqbX3diyZ32sGUXD6%2BXlujQ%2Fbr4NwdGbZxZASjaidcD9p7PxZrrNRgVUHcLvGwKBXn8AGyZQhKwlMh1ToiuPzkk5bMukuE1gXAp7VL99irEP%2BNdNJxOZpzadCx0dFte7DJuCwqsEgaqfoo1vEUpWeW5I7CXwcN%2BWePN%2BvF79tuIEpwae0gEqsBtv%2F4mLhxtunSkZQQTrutnEPAOhqAAU49tl4awl%2F0fID3wRpPDCKqg%2BfXifeRRPI2Tr%2Bm4PmK4qPffsI%2F5JXB4JA71uN5TkvMC6LxxTuQnJaTateDrfEDnzyyIVISjvQ7rzt8sxZCnDDfjzx6Lc5TAELuapDjeXK6w%2BWkbhwBTWcjrGAJvdaOA4IodaPZyDlyhO4jt1nv

文件上传临时凭证的安全令牌。

Signature String w7ke9GsiFjb2bR7bQNOOTk4nlbA

文件上传临时凭证的签名信息,用于上传时验证合法性。

HttpStatusCode String 200

HTTP请求返回的响应状态码。

Message String SpaceNotExist

错误信息。

RequestId String 93FC5921-2A54-408B-B360-2E5C93488CF4

唯一请求ID。

Success Boolean true

请求返回状态。

示例

请求示例

http(s)://[Endpoint]/?Action=GetWebHostingUploadCredential
&FilePath=/
&SpaceId=0e16bb12-14af-4635-b24c-5ac1a9a*****
&<公共请求参数>

正常返回示例

XML 格式

<GetWebHostingUploadCredentialResponse>
      <RequestId>93FC5921-2A54-408B-B360-2E5C93488CF4</RequestId>
      <HttpStatusCode>200</HttpStatusCode>
      <Data>
            <FilePath>/</FilePath>
            <Policy>eyJleHBpcmF0aW9uIjoiMjAyMC0wNS0yNlQwNjozMjoxOC43NTZaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsNTI0Mjg4MDBdLHsia2V5IjoiMGUxNmJiMTItMTRhZi00NjM1LWIyNGMtNWFjMWE5YTdiYjlmL2Zvcm1hdC5qc29uIn1dfQ==</Policy>
            <SecurityToken>CAISgQJ1q6Ft5B2yfSjIr5bWG%2FLNpY5Thbq6NFzwgTUsbuZ4grfe0Tz2IHBEeXRuA%2B0WsvQ%2Bnm9X6vgelqFZYqRoYGHiUZOjKEbIPUXzDbDasumZsJYm6vT8a0XxZjf%2F2MjNGZabKPrWZvaqbX3diyZ32sGUXD6%2BXlujQ%2Fbr4NwdGbZxZASjaidcD9p7PxZrrNRgVUHcLvGwKBXn8AGyZQhKwlMh1ToiuPzkk5bMukuE1gXAp7VL99irEP%2BNdNJxOZpzadCx0dFte7DJuCwqsEgaqfoo1vEUpWeW5I7CXwcN%2BWePN%2BvF79tuIEpwae0gEqsBtv%2F4mLhxtunSkZQQTrutnEPAOhqAAU49tl4awl%2F0fID3wRpPDCKqg%2BfXifeRRPI2Tr%2Bm4PmK4qPffsI%2F5JXB4JA71uN5TkvMC6LxxTuQnJaTateDrfEDnzyyIVISjvQ7rzt8sxZCnDDfjzx6Lc5TAELuapDjeXK6w%2BWkbhwBTWcjrGAJvdaOA4IodaPZyDlyhO4jt1nv</SecurityToken>
            <BucketName>fbpsbvmo-154159039388***-static</BucketName>
            <Endpoint>fbpsbvmo-154159039388***-static.oss-cn-zhangjiakou.aliyuncs.com</Endpoint>
            <AccessKeyId>STS.NUcPHyHQr2xQ6zAe5ybi*****</AccessKeyId>
            <Signature>w7ke9GsiFjb2bR7bQNOOTk4nlbA</Signature>
            <ExpiredTime>1590460358</ExpiredTime>
      </Data>
      <Code>success</Code>
      <Success>true</Success>
</GetWebHostingUploadCredentialResponse>

JSON 格式

{
    "RequestId": "93FC5921-2A54-408B-B360-2E5C93488CF4",
    "HttpStatusCode": "200",
    "Data": {
        "FilePath": "/",
        "Policy": "eyJleHBpcmF0aW9uIjoiMjAyMC0wNS0yNlQwNjozMjoxOC43NTZaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsNTI0Mjg4MDBdLHsia2V5IjoiMGUxNmJiMTItMTRhZi00NjM1LWIyNGMtNWFjMWE5YTdiYjlmL2Zvcm1hdC5qc29uIn1dfQ==",
        "SecurityToken": "CAISgQJ1q6Ft5B2yfSjIr5bWG%2FLNpY5Thbq6NFzwgTUsbuZ4grfe0Tz2IHBEeXRuA%2B0WsvQ%2Bnm9X6vgelqFZYqRoYGHiUZOjKEbIPUXzDbDasumZsJYm6vT8a0XxZjf%2F2MjNGZabKPrWZvaqbX3diyZ32sGUXD6%2BXlujQ%2Fbr4NwdGbZxZASjaidcD9p7PxZrrNRgVUHcLvGwKBXn8AGyZQhKwlMh1ToiuPzkk5bMukuE1gXAp7VL99irEP%2BNdNJxOZpzadCx0dFte7DJuCwqsEgaqfoo1vEUpWeW5I7CXwcN%2BWePN%2BvF79tuIEpwae0gEqsBtv%2F4mLhxtunSkZQQTrutnEPAOhqAAU49tl4awl%2F0fID3wRpPDCKqg%2BfXifeRRPI2Tr%2Bm4PmK4qPffsI%2F5JXB4JA71uN5TkvMC6LxxTuQnJaTateDrfEDnzyyIVISjvQ7rzt8sxZCnDDfjzx6Lc5TAELuapDjeXK6w%2BWkbhwBTWcjrGAJvdaOA4IodaPZyDlyhO4jt1nv",
        "BucketName": "fbpsbvmo-154159039388***-static",
        "Endpoint": "fbpsbvmo-154159039388***-static.oss-cn-zhangjiakou.aliyuncs.com",
        "AccessKeyId": "STS.NUcPHyHQr2xQ6zAe5ybi*****",
        "Signature": "w7ke9GsiFjb2bR7bQNOOTk4nlbA",
        "ExpiredTime": "1590460358"
    },
    "Code": "success",
    "Success": "true"
}