We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.

HMS Core ReferencesDrive KitServer APIFilessubscribe

Files:subscribe

Tracks changes to a file.

Request

HTTP Request

POST
https://drive.cloud.hicloud.com/drive/v1/files/{fileId}/subscribe

Parameters

*Some parameters are mandatory.

Parameter NameType
Description
fileIdstringpathFile ID. (Mandatory)
fieldsstringqueryFields in the request, which are in the partial response format.
formstringqueryMedia format.
prettyPrintbooleanqueryIndicates whether to return a response in a human-readable format.
quotaIdstringqueryUser identifier, consisting of 40 characters at maximum. It is used to restrict the number of API calls of an individual user.
callbackstringqueryCallback function used in JSONP requests.
x-hw-trace-idstringheaderID used for service tracing.
x-hw-app-idstringheaderApp ID. 
versionstringheaderSDK version number.
x-hw-terminalstringheaderDevice model. 
x-hw-osstringheaderDevice operating system.
unionIDstringheaderOpen user ID.
User-AgentstringheaderApp version number or ID.

Request Body

In the request body, provide data with the following structure:

Parameter NameTypeDescription
idstringA unique string that identifies this channel.(Mandatory)
userTokenstringA string that is sent to the target address along with each notification that is sent on this channel.(Mandatory)
typestringType of delivery mechanism that is used for this channel. Value: web_hook.(Mandatory)
urlstringThe address where notifications are delivered for this channel.(Mandatory)
expirationTimeintegerDate and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. File resources will expire within one day, while change resources will expire within one week.

Response

If successful, this method returns a response body with the following structure:

Collapse
Word wrap
Dark theme
Copy code
  1. {
  2.            "category": "api#channel",
  3.            "id": "string",
  4.            "resourceId": "string",
  5.            "resourceUri": "string",
  6.            "userToken": "string",
  7.            "expirationTime": 0,
  8.            "type": "string",
  9.            "url": "string"
  10. }
Parameter NameTypeDescription
categorystringResource type. The value is always api#channel.
idstringID.
resourceIdstringResource ID, which identifies the resource being tracked on this channel.
resourceUristringA version-specific identifier for the tracked resource.
userTokenstringA string that is sent to the target address along with each notification that is sent on this channel.
expirationTimeintegerDate and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. File resources will expire within one day, while change resources will expire within one week.
typestringType of delivery mechanism that is used for this channel.
urlstringCallback address.
This page may contain third-party content. For details, click here.
Search in References
Enter a keyword.