Obtain Temporary Credential

2022-06-23
No Rating

Device report obtain Temporary Credential

Topic:

thing/product/{pid}/requests

Parameter Explanation:

ParameterRequiredTypeIllustration
tidYesstring
bidYesstring
methodYesstringmessage Type
timestampYesint13-bit timestamp
dataYesobject
» moduleYesintModule enumeration value 0 - Media

Example:

//Topic: thing/product/{pid}/requests
{
    "method":"storage_config_get",
    "tid":"123",
    "bid":"456",
    "timestamp":"1234567890123",
    "data":{
       "module": 0
    }
}

Server Send Temporary Credential

Topic:

thing/product/{pid}/requests_reply

Parameter Explanation:

ParameterRequiredTypeIllustration
tidYstring
bidYstring
methodYstringmessage Type
timestampYint13-bit timestamp
dataYobject
» resultYintThe response result of 0 means normal
» outputYobjectOutput
»» endpointYstringAccess domain name for external services
»» object_key_prefixYstringThe key prefix of the file in the object storage bucket
»» providerYstringCloud vendor enumeration value
* ali - Ali cloud
* aws - Amazon cloud
»» regionYstringThe region where the data center is located, refer to the corresponding cloud vendor region enumeration value
»» bucketYstringName of the object storage bucket
»» credentialsYobjectCredential information
»»» access_key_idYstringAccess key ID (used for cloud vendor logo user)
»»» access_key_secretYstringSecret access key (the key used to encrypt the signature string and the cloud vendor uses to verify the signature string)
»»» expireYintAccess key expiration time. Unit: seconds
»»» security_tokenYstringsession token
// topic  thing/product/{pid}/requests_reply
{
    "method":"storage_config_get",
    "tid":"123",
    "bid":"456",
    "timestamp":"1234567890123",
    "data":{
        "result":0,
        "output":{
            "bucket":"bucket_name",
            "credentials":{
                "access_key_id":"access_key_id",
                "access_key_secret":"access_key_secret",
                "expire":3600,
                "security_token":"security_token"
            },
            "endpoint":"https://oss-cn-hangzhou.aliyuncs.com",
            "object_key_prefix":"b4cfaae6-bd9d-4cd0-8472-63b608c3c581",
            "provider":"ali",
            "region":"hz"
        }
    }
}