You need to use the Token to change the status. For more details, please check Token.
Initiate a pre-signed request to obtain pre-signed information for uploading files.
Based on the pre-signed information, upload the audience package file.
File requirements:
https://ss-api.mintegral.com/api/open/v1/audience/presigned-upload-data
GET
GET /api/open/v1/audience/presigned-upload-data?area_type=1&file_name=test.txt&file_md5=1ceada6012b007afb4b0a29984660ad0 HTTP/1.1
Host: ss-api.mintegral.com
Fields | Type | Explanations | Default Value | Value Examples |
---|---|---|---|---|
area_type | int | Data Cluster 1:Outside Mainland of China |
-- | 1 |
file_name | string | file name | -- | test.txt |
file_md5 | string | file MD5 | -- | 1ceada6012b007afb4b0a29984660ad0 |
Fields | Type | Explanations |
---|---|---|
code | int | 200 code, is success. Others, are fail. |
msg | string | If success, return to “success”. If fail, return to detailed wrong info. |
data | object | If success, return to “success”. If fail, return to detailed wrong info. |
data.area_type | int | Data cluster 1: Non-mainland China area, 2: Mainland China area |
data.file_name | int | File name |
data.file_md5 | int | File MD5 |
data.ttl | int | Time-to-live (in seconds) |
data.s3 | object | Information for uploading files to S3 |
data.s3.method | string | Request method for uploading files to S3 |
data.s3.url | string | Request URL for uploading files to S3 |
data.s3.data_path | string | Full path for uploading files to S3, used for Create Audience |
{
"code": 200,
"message": "success",
"data": {
"area_type": 1,
"file_name": "audience_file.txt",
"file_md5": "1ceada6012b007afb4b0a29984660ad0",
"ttl": 300,
"s3": {
"method": "{data.s3.method}",
"url": "{data.s3.url}",
"data_path": "{data.s3.path}"
}
}
}
curl -X {data.s3.method} -T "{path_to_file}" "{data.s3.url}"
For example:
The pre-signed information returned by the pre-signed request interface.
{data.s3.method} = PUT
{data.s3.url} = https://upload.s3.amazonaws.com?abc=123
{data.s3.path} = s3://s3/path/to/file
Your file path
{path_to_file} = /path/to/file
curl -X PUT -T "/path/to/file" "https://upload.s3.amazonaws.com?abc=123"
After successful upload, use {data.s3.data_path} for Create Audience.