Get an Upload Credential
Retrieves a pre-signed upload credential for uploading a contact file to the object storage service. The file can then be imported by the contact import interfaces.
Request URL
POST {base_url}/uc-ccontact/api/v1/resources/upload-credential
Request parameters
- Headers
-
Parameter Required Type Description Authorization Yes String The access token used for authentication. Format: Bearer
{access_token}.x-tenant-code Yes String The tenant name. Note: You can obtain tenant name using the Query Tenants interface.
- Body parameters
-
Parameter Required Type Description bizType Yes String The business type of the file to upload.
Valid value:
company_contact_importpersonal_contact_import
contentType No String The MIME type of the file, for example text/csv. The same value must be carried in theContent-Typeheader when the file is uploaded.
Response parameters
| Parameter | Type | Description |
|---|---|---|
| requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
| code | String | The HTTP status code of the request.
|
| message | String | The status message of the request. |
| detailMessage | String | The detailed error information. When the request is successful, this parameter returns empty. |
| result | Object<Upload_Credential> | The upload credential. |
- Upload_Credential
-
Parameter Type Description resourceId String The pre-allocated resource ID, which is passed as resourceIdwhen the contact import interface is called.uploadUrl String The pre-signed upload URL. Send a PUTrequest to this URL to upload the file.httpMethod String The HTTP method to use for the upload, which is always PUT.headers Object The request headers to carry when the file is uploaded, for example content-type. The key is the header name and the value is the header value. The headers must be passed through as returned.expiresIn Integer The validity period of the credential, in seconds. The value is always 900(10 minutes).