Skip to main content
Version: SDK-3.10

List of graphite APIs

Note

⚠️ Unless otherwise specified, all requests are , HTTPand both the request header and the return header Content-Type are application/json .

⚠️ shimo-domain Refers to the domain name of the Graphite SDK server, please contact Graphite to obtain this domain name.

⚠️ If there is a special symbol in the parameter value in the route, it is recommended to escape the value, please refer to JavaScript escaping method MDN.

Account and application management

get app detail

Obtain app details, including app name, available file types, number of activated users, total number of users, number of seats, license validity period, and callback address information.

warning

Due to the special nature of the app API, for security reasons, you need to attach the field when "scope": "license"generating the signature

The address of the request

GET https://shimo-domain/sdk/v2/api/license/apps/{appId}

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl "https://shimo-domain/sdk/v2/api/license/apps/yourShimoAppId?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString"

HTTP status code

Status codeillustrate
200The return is successful

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
appNamestringyour app nameThe name of the app
availableFileTypesArray["document","documentPro","spreadsheet","presentation","table"]List of available graphite kits
activatedUserCountnumber43The number of users who have activated seats
userCountnumber50The total number of users, including已激活 , , and已禁用 the 未使用 total number of users, and only 已激活 the number of occupied seats
memberLimitnumber99The license seat limits the number of users, that is, the 已激活 maximum number of users
validFromstring2020-12-31T16:00:00ZThe effective time of the license
validUntilstring2022-12-30T16:00:00ZThe expiration date of the license term
endpointUrlstringhttp://your-domainThe callback address of the service provider

Example

{
"appName": "your app name",
"availableFileTypes": [
"document",
"documentPro",
"spreadsheet",
"presentation",
"table"
],
"activatedUserCount": 43,
"userCount": 50,
"memberLimit": 99,
"validFrom": "2020-12-31T16:00:00Z",
"validUntil": "2022-12-30T16:00:00Z",
"endpointUrl": "http://your-domain"
}

update-app-endpoint-url

Used to update the callback address of the corresponding service provider of the app

warning

Due to the special nature of the app API, for security reasons, you need to attach the field when "scope": "license"generating the signature

The address of the request

PUT https://shimo-domain/sdk/v2/api/license/apps/{appId}/endpoint-url

Parameter transfer methodSeveral participantstypeExamples of valuesRequiredillustrate
PathappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

The name of the fieldtypeExamples of valuesRequiredillustrate
urlstringhttp://your-domainbeThe callback address of the service provider that needs to be updated

Sample request

curl -X "PUT" "https://shimo-domain/sdk/v2/api/license/apps/yourShimoAppId/endpoint-url?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString" \
-H 'Content-Type: application/json' \
-d $'{
"url": "http://your-domain"
}'

HTTP status code

Status codeillustrate
204The creation is successful

HTTP Response Body

empty

Collaborative documentation

create-collab-file

Create a collaborative document of the specified type

The address of the request

POST https://shimo-domain/sdk/v2/api/files

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method
QuerylangstringinnotOptional. The default value is the server-side default language setting, which usually defaults to .zh-CN Specify the language information when creating the file, and the following values are optional:zh-CN (Chinese Simplified), en(English), (Japaneseja).

HTTP Request Headers

Header 名valueRequiredillustrate
Accept-LanguageZ-Sun,Z; K=0.9,N; Q=0.8notIf there is no lang parameter by default, try to identify this header, if this header is not passed, the server default language is used. The Accept-Languge format refers to MDN Accept-Language

HTTP Request Body

The name of the fieldtypeExamples of valuesRequiredillustrate
typestringdocumentbeFor graphite file types, please refer to the "Supported File Types" section for optional values
fileIdstringfilid1001beThe unique ID of the file that connects to the service provider must be a string no longer than 64 in length

Sample request

curl --location --request POST 'https://shimo-domain/sdk/v2/api/files?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--header 'Content-Type: application/json' \
--data-raw '{"type": "document","fileId": "83478944-8d4c-4936-baff-20ab180eb712"}'

HTTP status code

Status codeillustrate
204The creation is successful

HTTP Response Body

empty

Supported document types

file typeType value
Light documentsdocument
formspreadsheet
Traditional documentationdocumentPro
slidepresentation
Application tablestable
说明

In addition to 轻文档, ,传统文档``表格 , and , 幻灯片other types are non-standard functions (such as 应用表格), please contact Graphite customer service for details.

Notes

With the exception 轻文档 of , all 应用表格 file types are highly compatible with Office formats

Load the editor after creation

Refer to the steps in "Collaborative Documentation - Access Process" to initialize the use of graphite JSSDK and follow the parameter instructions.

Create a collaborative copy of the document

Creates a copy of the specified collaboration document

The address of the request

POST https://shimo-domain/sdk/v2/shimo-files/{fileId}/copy

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

The name of the fieldtypeExamples of valuesRequiredillustrate
fileIdstringfilid1001beThe new file ID, the unique ID of the file accessing the service provider, must be a string no larger than 64 in length

Sample request

curl --location --request POST 'https://shimo-domain/sdk/v2/api/files/e0f238d1-8c10-448c-bf69-cd315051c095/copy?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--header 'Content-Type: application/json' \
--data-raw '{"fileId": "83478944-8d4c-4936-baff-20ab180eb712"}'

HTTP status code

Status codeillustrate
204The creation is successful
200When a request is repeated, a copy of the file is being executed, responding to the data {"code":70019}
400When the request is repeated, the target file association data exists, but the information of the Create Replica task cannot be found, and the data {"code":70016} is responded
400If the request is repeated, the data associated with the target file exists, and the replica fails to be created, and the data is responded {"code":70017}
500When repeating the request, an error was encountered when creating a copy of the source file content, responding to the data {"code":70015}
500When repeating the request, an error was encountered while getting the Create Replica task in response to data {"code":70018}
500Duplicate requests are repeated when the status of the Create Replica task is unknown and the response data is unknown {"code":70020}

HTTP Response Body

empty

Delete the collaboration document

Deletes a collaboration document of the specified type, requiring the user to have permission on the document manageable .

The address of the request

DELETE https://shimo-domain/sdk/v2/api/files/{fileId}

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

not

Sample request

curl --location --request DELETE 'https://shimo-domain/sdk/v2/api/files/e0f238d1-8c10-448c-bf69-cd315051c095?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString'

HTTP status code

Status codeillustrate
204The operation was successful

HTTP Response Body

empty

Get the history list

Get the file sidebar history list information

The address of the request

getttps ://shimo-domain/sdk/v2/smo-files/{filed}/doc-sidebar-info

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method
QuerypageSizenumber10notThe number of entries returned per page, recommended value10, and too 20 large will affect the response time. The default value is 10
Querycountnumber0notThe number of records that need to be skipped on the current page can count = (page - 1) * pageSize be obtained by . The default value is 0
QueryhistoryTypenumber1notOptional values:1 Operation history (such as the history of operations resulting from modifications that did not actually write such as locked cells),2 edit history. When not passed, all types are returned by default

Sample request

curl --location --request GET 'https://shimo-domain/sdk/v2/shimo-files/<fileId>/doc-sidebar-info?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString'

HTTP status code

Status codeillustrate
200The return is successful

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
historiesarraySidebar history array
histories[i].contentstringCollaborate on file format data
histories[i].createdAtstring2021-06-07T06:12:24ZThe history of the sidebar creation time of this article
histories[i].historyTypenumber2The sidebar history type, 1 is the operation history and 2 is the edit generated
histories[i].idstring60bdb8c847a7850006bf12c1Sidebar history ID
histories[i].namestring历史 1Sidebar historical name
histories[i].updatedAtstring2021-06-07T06:12:24ZThe sidebar history was last updated
histories[i].userIdstringuser123,user134Vendor user IDs, which may be several, separated by a comma ","
isLastPagebooleanWhether it's the last page
limitnumber100The size of the pagination
usersobject{ "user123": "User A" }The service provider user ID corresponds to the username mapping

Example

{
"histories": [
{
"content": "{\"range\":[1,1],\"changeset\":\"[[10, \\\"\\\\n\\\", \\\"line:\\\\\\\"init\\\\\\\"\\\"]]\",\"frozen\":true}",
"createdAt": "2021-06-07T06:12:24Z",
"historyType": 2,
"id": "60bdb8c847a7850006bf12c1",
"name": "",
"updatedAt": "2021-06-07T06:12:24Z",
"userId": "user123,user134"
},
{
"content": "{\"range\":[2,3],\"changeset\":\"省略若干内容 ...\"}",
"createdAt": "2021-06-07T06:12:39Z",
"historyType": 2,
"id": "60bdb8d747a7850006bf12c2",
"name": "",
"updatedAt": "2021-06-07T06:12:39Z",
"userId": "user123,user134"
},
{
"content": "{\"action\":\"unlock_cell\",\"range\":[\"E14:E14\"],\"name\":\"工作表1\"}",
"createdAt": "2022-03-11T03:58:59Z",
"historyType": 1,
"id": "622ac9034079aa0006d54f3b",
"name": "",
"updatedAt": "2022-03-11T03:58:59Z",
"userId": "user123"
},
{
"content": "{\"action\":\"lock_sheet\",\"name\":\"工作表1\"}",
"createdAt": "2022-03-11T03:59:04Z",
"historyType": 1,
"id": "622ac9084079aa0006d54f3c",
"name": "",
"updatedAt": "2022-03-11T03:59:04Z",
"userId": "user123"
}
],
"isLastPage": true,
"limit": null,
"users": {
"user123": "testuser",
"user134": "testuser2"
}
}

Historical type description

操作历史 (historyType = 1)

For records that are manually operated and do not usually cause changes in the text of the file, the type and context information of such history is stored in the content field in the form of JSON strings.

The known operations are as follows, and the JSON data is histories[i].content the result of the field JSON.parse

createRevision 创建版本
{
"action": "createRevision"
}
renameRevision Rename the version
{
"action": "renameRevision",
"before": "修改前的版本名称",
"after": "修改后的版本名称"
}
deleteRevision 删除版本
{
"action": "deleteRevision",
"label": "被删除的版本名称"
}
lock_cell Lock the cell
{
"action": "lock_cell",
"range": "E14:E14",
"name": "工作表1"
}
unlock_cell Unlock the cell
{
"action": "unlock_cell",
"range": ["E14:E14"],
"name": "工作表1"
}
lock_sheet Lock the worksheet
{
"action": "lock_sheet",
"name": "工作表1"
}
unlock_sheet Unlock the worksheet
{
"action": "unlock_sheet",
"name": "工作表1"
}
update_lock_cell Update cell locking
{
"action": "update_lock_cell",
"range": ["E17:E17"],
"name": "工作表1"
}
编辑历史 (historyType = 2)

Indicates that one or more users have made edits to a file over a period of time

Get a list of versions

Obtain the file version list information

The address of the request

GET https://shimo-domain/sdk/v2/shimo-files/{fileId}/revisions

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl --location --request GET 'https://shimo-domain/sdk/v2/shimo-files/<fileId>/revisions?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString'

HTTP status code

Status codeillustrate
200The return is successful

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
idstring11089Version ID
labelstringMonday, 6/7/2021 14:33Version Label
titlestring123title
docHistoryIdstring60bdbda2f0a8af000664d719Corresponding sidebar history ID
createdAtstring2021-06-07T06:33:13ZSidebar history created time
updatedAtstring2021-06-07T06:33:13ZSidebar history update time
user.idstringuser123Vendor User ID
user.namestringtestuserUsername

Example

[
{
"id": 11089,
"label": "2021/6/7 星期一 14:33",
"title": "123",
"docHistoryId": "60bdbda2f0a8af000664d719",
"createdAt": "2021-06-07T06:33:13.000Z",
"updatedAt": "2021-06-07T06:33:13.000Z",
"user": {
"id": "user123",
"name": "testuser"
}
},
{
"id": 11090,
"label": "2021/6/7 星期一 14:33",
"title": "123",
"docHistoryId": "60bdbdd5f0a8af000664d71d",
"createdAt": "2021-06-07T06:33:59.000Z",
"updatedAt": "2021-06-07T06:33:59.000Z",
"user": {
"id": "user123",
"name": "testuser"
}
}
]

Get the plain text content of the file

Gets the plain text content of a specified file

The address of the request

GET https://shimo-domain/sdk/v2/shimo-files/{fileId}/plain-text

HTTP Request Parameters

Parameter transfer methodSeveral participantstypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl --location --request GET 'https://shimo-domain/sdk/v2/shimo-files/<fileId>/plain-text?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString'

HTTP status code

Status codeillustrate
200The return is successful

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
contentstringThe plain text content of the fileThe plain text content of a graphite file obtained based on the specified file ID

Example

{
"content": "文件纯文本内容"
}

Get a list of all at people in the file contents

Get a list of all at people in the file contents

Supported file types:

  • document Light documents
  • documentPro Traditional documentation
  • spreadsheet form

The address of the request

GET https://shimo-domain/sdk/v2/shimo-files/{fileId}/mention-at-list

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl "https://shimo-domain/sdk/v2/shimo-files/ad8ed1afa8172d91/mention-at-list?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString"

HTTP status code

Status codeillustrate
200The return is successful

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
mentionAtListArrayA list of all at information in a graphite file obtained based on the specified file ID
mentionAtList.userId[0]stringuser1at the user ID of the mentions
mentionAtList.atGuid[0]stringMODOCnb4HPu04G8fat mentions the corresponding location tag in the file

Example

{
"mentionAtList": [
{
"userId": "1",
"atGuid": "MODOCnb4HPu04G8f"
},
{
"userId": "4",
"atGuid": "MODOCPryKBQpdLVS"
},
{
"userId": "3",
"atGuid": "MODOC6IQPpxpi5RV"
},
{
"userId": "1", // 同个用户在不同位置被 at
"atGuid": "MODOCSxgFvWiIupK"
}
]
}

Get the number of comments in a file

Get the total number of comments in a file

Supported file types:

  • spreadsheet form

The address of the request

GET https://shimo-domain/sdk/v2/shimo-files/{fileId}/comment-count

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl "https://shimo-domain/sdk/v2/shimo-files/fe143ca1a08e9976/comment-count?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString"

HTTP status code

Status codeillustrate
200The return is successful

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
countnumber2Number of comments

Example

{
"count": 2
}

File preview

Note

⚠️ This feature does not support editing documents, if you want to edit documents, please refer to 协同文档.

Create a preview

Create a preview task synchronously, and if it fails, return the reason for the failure

The address of the request

POST https://shimo-domain/sdk/v2/api/cloud-files/{fileID}/create

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExample valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl --location -g --request POST 'https://shimo-domain/sdk/v2/api/cloud-files/{{fileID}}/create?signature=yourSignatureString&token=yourTokenString'

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
codestring90028Create a preview result status code, with an empty string indicating that the creation is successful, and a non-empty string indicating that the creation fails
messagestringfile is convertingCreate a failed error message

Example

// 创建失败
{
"code": "90042",
"message": "文件格式不正确"
}
// 创建成功
{
"code": "",
"message": ""
}

Access the preview

The page used to render the preview on the browser needs to be used with an embedded iframe

For the same file, when you call this API for the first time, the backend will asynchronously call the "Create Preview" API to create a task, and the preview page will be rendered only after the creation is successful. If you need to speed up the first time you open a file, you can call the Create Preview API on the server to create a preview in advance

The address of the request

GET https://shimo-domain/sdk/v2/api/cloud-files/{fileID}/page

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExample valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method
Querylangstringzh-CNnotThe language settings in the page, default zh-CN, optional en-US, ja-JP

Embed iframes to use

<html>
<head>
<!-- some code -->
</head>
<body>
<!-- your HTML elements -->
<div id="shimo-sdk-preview" class="shimo-sdk-preview">
<iframe
src="https://shimo-domain/sdk/v2/api/cloud-files/{{fileID}}/page?signature=yourSignatureString&token=yourTokenString&lang=zh-CN"
style="border: none; overflow: hidden;"
></iframe>
</div>
</body>
</html>

Import and export

Import file

caution

⚠️ This API is a new version of the API for importing files, and it is recommended that you use it first. The new version of the import file API requires the accessing party to parse the taskId in the result, and to bring the taskId parameter when calling "(New) Get Import Progress". The maximum time for a task to be executed is 10 minutes.

The process of importing files is an asynchronous process, and the successful interface request only means that the import service receives and starts processing the import request.

The address of the request

POST https://shimo-domain/sdk/v2/api/files/v1/import

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe user credential provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
FormfileIdstringfile1001beThe unique ID of the service provider's file
FormtypestringdocumentProbeThe type of file that needs to be imported
FormfilefilenotFiles that need to be imported (fileUrl, fileName must be passed if the file is not sent)
FormfileUrlstringhttps://domain.com/files/download/test.docxnotThe download address of the file to be imported (there is a parameter file, you don't need to pass it)
FormfileNamestringtest.docxnotThe name of the file to be imported (there is a parameter file, you don't need to pass it)
caution

⚠️ Unless otherwise specified, the file name of the imported file needs to be accompanied by an extension, otherwise it may fail to parse, such as "测试文件.doc" or the file name with the extension in the FormData"" or use filename the time field, refer to MDN.

Sample request

curl --location --request POST 'https://shimo-domain/sdk/v2/api/files/v1/import?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--form 'fileId="{{importFileId}}"' \
--form 'type="document"' \
--form 'file=@"/your/local/path/测试.docx"'

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
statusnumber0The import status, with a non-zero value indicating an exception
messagestringA message will be displayed when an exception is imported
data.taskIdstringTnJdQS8Wk70wNHuBThe ID of the import task, and bring it when you call the import progress API. When the import fails, provide this ID for debugging

Import a supported file format

Graphite file typeSupported file types for import
documentdocx,doc,md,txt
documentProdocx,doc,wps
spreadsheetxlsx,xls,csv, xlsm
presentationpptx,ppt

Get the import progress

caution

⚠️ This API is the new version of the API for obtaining import progress, and it is recommended that you use it first. When the task is completed, the progress result will be cached for 5 minutes by default (configurable), and the progress result will fail to be called again after the expiration date.

The address of the request

POST https://shimo-domain/sdk/v2/api/files/v1/import/progress

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QuerytaskIdstringTnJdQS8Wk70wNHuBbeThe taskId returned by the import file interface
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe user credential provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl --location -g --request POST 'https://shimo-domain/sdk/v2/api/files/v1/import/progress?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString&taskId={{taskId}}' \
--data-raw ''

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
statusnumber0The import status, with a non-zero value indicating an exception
messagestringA message will be displayed when an exception is imported
data.progressnumber100The import progress percentage, which is 100 for import completion

illustrate

By polling the interface until the return is data.progress 100 a time representation导入完成, you can view or edit it on the page by docking with the front-end js-SDK.

Export File

caution

⚠️ This API is a new version of the export file API and is recommended to be used first. The new version of the export file API requires the accessing party to parse the taskId in the result and call " ( New ) to get the export progresstaskId parameter. This interface allows you to export the same graphite file to different file types at the same time, for example, to export a light document to both PDF and Word formats at the same time. The maximum time for a task to be executed is 10 minutes.

Export online editing files to Office files, PDFs, and more, which are supported by different suites, as shown below.

The export process is an asynchronous process, the success of the interface request only means that the export service receives and starts to process the export request, whether it is successful or not, you need to poll the "(new version) get export progress" interface to check whether the export task is completed, when the task is completed, use the link (field) returned by "get export progress" data.downloadUrl to download the file.

The address of the request

POST https://shimo-domain/sdk/v2/api/files/v1/export/{fileId}

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe user credential provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
BodytypestringdocxnotThe file type that needs to be exported is exported according to the default type when it is not transmitted

Export supported file formats

Graphite file typeThe default exported file typeSupported file types for export
documentdocxDocs, MD, JPG, PDF
documentProdocxdocx, pdf, wps
spreadsheetxlsxxlsx
presentationpptxPPTX, PDF

Sample request

curl --location -g --request POST 'https://shimo-domain/sdk/v2/api/files/v1/export/{{exportFileId}}?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--header 'Content-Type: application/json' \
--data-raw '{"type": "docx"}'

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
statusnumber0The export status, with a non-zero value indicating an anomaly
data.taskIdstring3oo4vnBJgcG5HxMm:1:603:xmindThe ID of the export task, please bring this parameter when calling the export progress API, and provide this ID for debugging when the export fails
messagestringNotification information when an exception is exported

Get export progress

caution

⚠️ This API is the new version of the API for obtaining import progress, and it is recommended that you use it first. Progress results will be cached for 5 minutes (configurable) by default, and recalling progress results will fail after expiration.

The address of the request

POST https://shimo-domain/sdk/v2/api/files/v1/export/progress

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QuerytaskIdstring3oo4vnBJgcG5HxMm:1:603:xmindbeThe taskId returned by the export file interface
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe user credential provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl --location -g --request POST 'https://shimo-domain/sdk/v2/api/files/v1/export/progress?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString&taskId={{taskId}}' \
--data-raw ''

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
statusnumber0The export status, with a non-zero value indicating an anomaly
messagestringNotification information when an exception is exported
data.progressnumber100The export progress percentage, which is 100 for import completion
data.downloadUrlstringThe download address of the exported file

illustrate

The export is complete by polling the interface until the returned data.progress is 100

Export table to Excel

The export application table returns the download address of the .xlsx file

The address of the request

Post Hatpas://shimo-domain/SDK/v2/API/Files/Export/Table-sheets/{filed}

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe user credential provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

Sample request

curl -X "POST" "https://shimo-domain/sdk/v2/api/files/export/table-sheets/:fileId?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString"

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
statusnumber0The export status, with a non-zero value indicating an anomaly
messagestringNotification information when an exception is exported
downloadUrlstring.xlsx The address where the file was downloaded

Table content operations

Get the contents of the form

Gets the table content based on the incoming range

The address of the request

GET https://shimo-domain/sdk/v2/api/files/{fileId}/sheets/values

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method
QueryrangestringWorksheet 1! A1:C3beRefer to the following parameter description range

Sample request

curl --location --request GET 'https://shimo-domain/sdk/v2/api/files/<fileId>/sheets/values?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString&range=工作表1!A1:C3'

HTTP status code

Status codeillustrate
200The return is successful

HTTP Response Body

The name of the fieldtypeExamples of valuesillustrate
valuesarray[["Name", "Age", "Gender"],["Xiao Ming", 29, "Male"]]Table cell values

Example

{
"values": [
["姓名", "年龄", "性别"],
["小明", 29, "男"],
["小强", 18, "男"],
["小兰", 20, "女"],
[null, null, "a"]
]
}

Supported file types

file typeType value
formspreadsheet

Update the content of the table

Updates the table content based on the incoming range

The address of the request

POST https://shimo-domain/sdk/v2/api/files/{fileId}/sheets/values

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

The name of the fieldtypeExamples of valuesillustrate
rangestringWorksheet 1! A1:C3Refer to the following parameter description range
resourceobjectRefer to the following parameters to describe resource

Sample request

curl --location --request POST 'https://shimo-domain/sdk/v2/api/files/<fileId>/sheets/values?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--header 'Content-Type: application/json' \
--data-raw '{
"range": "工作表1!A1:C3",
"resource": {
"values": [
["第一行第一列的值","第一行第二列的值"],
["第二行第一列的值","第二行第二列的值"]
]
}
}'

HTTP status code

Status codeillustrate
204The return is successful

HTTP Response Body

empty

Supported file types

file typeType value
formspreadsheet

The contents of the table are appended

Append the table content based on the incoming range (only plain text and numbers are supported). The logic for finding append locations based on range is as follows: Find the row position that needs to be appended: a. Don't specify a range of cells, e.g. Sheet 1: will go through the whole table to find the last row with data b. Specify a range of cells, e.g. Sheet 1! C5:E8: will find the row where the starting cell C5 is located, traverse down from that row, find the last consecutive row with data and insert N rows downward, populating values, where N = values.length If a non-existent column is modified, it is automatically added to the column

The address of the request

Put Hotpas://shimo-domain/SDK/V2/API/Files/{filed}/sheets/values

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

The name of the fieldtypeExamples of valuesillustrate
rangestringWorksheet 1! A1:C3Refer to the following parameter description range
resourceobjectRefer to the following parameters to describe resource

Sample request

curl --location --request PUT 'https://shimo-domain/sdk/v2/api/files/<fileId>/sheets/values?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--header 'Content-Type: application/json' \
--data-raw '{
"range": "工作表1!A1:C3",
"resource": {
"values": [
["第一行第一列追加文本","第一行第二列追加文本"],
["第二行第一列追加文本","第二行第二列追加文本"]
]
}
}'

HTTP status code

Status codeillustrate
204The return is successful

HTTP Response Body

empty

Supported file types

file typeType value
formspreadsheet

Delete table rows

Description: Starting with index, delete the number of rows with the quantity count

The address of the request

delete hatps://shimo-domain/sdk/v2/api/files/{filed}/sheets/{sheetname}/rose/{index}

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
PathsheetNamestringWorksheet 1beThe name of the worksheet in the table
Pathindexnumber0beDelete from the first few lines
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method
Querycountnumber1notDelete a few rows, default to 1

HTTP Request Body

empty

Sample request

curl --location --request DELETE 'https://shimo-domain/sdk/v2/api/files/<fileId>/sheets/工作表1/rows/0?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString&=2'

HTTP status code

Status codeillustrate
204The return is successful

HTTP Response Body

empty

Supported file types

file typeType value
formspreadsheet

Added tabular worksheets

Note: A worksheet has been added

The address of the request

Post Hatps://shimo-domain/sdk/v2/api/files/{filed}/sheets/

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
PathfileIdstringqeK4Xdxvxg8jF5gzbeThe file ID is located in the URL path of the API to create the preview API, and this file ID is a unique ID in the file list of the access service provider, and Graphite will request the file interface of the access service provider to obtain the file information and download address based on this ID
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

The name of the fieldtypeExamples of valuesillustrate
namestringWorksheet 2Added table worksheet name

Sample request

curl --location --request POST 'https://shimo-domain/sdk/v2/api/files/<fileId>/sheets?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--header 'Content-Type: application/json' \
--data-raw '{"name": "工作表2"}'

HTTP status code

Status codeillustrate
204The return is successful

HTTP Response Body

empty

Supported file types

file typeType value
formspreadsheet

Parameter description

range

The format is ${worksheet}!${cell range}, and the specification is as follows:

  • The format of the cell range is A1:C10 or A1, and the cell start position cannot exceed the largest row and column of the table
  • If the worksheet name contains the 3 featured characters !:', you must wrap the worksheet name in single quotation marks. Example: Worksheet 1 | Worksheet 1! A1 | Worksheet 1! A1:C1 | 'Work!: Table'! A2:C3

resource

The type is object, which must contain the key value "values". values is a two-dimensional array that represents appended/updated table contents, with the first dimension representing rows and the second dimension representing columns. An empty string means that the current cell is empty. Example:

返回一行数据
{
"resource": {
"values": [[1, "", "a"]]
}
}
返回多行数据
{
"resource": {
"values": [
[1, "", "a"],
["b", "c", 2]
]
}
}

Date type OADate numeric conversion

The return value of the date type is a value of the OADate type, for example, the date in the cell is 2022/7/27 , and the returned value is 44769 .

Refer to the following JavaScript code to convert:

convertOADateToLocaleDateString.js
function _getTimezoneOffset(date) {
let offset = date.getTimezoneOffset();
if (offset === -485) {
offset = -485 - 43 / 60;
}
return offset;
}

function _fromOADate(oadate) {
const offsetDay = oadate - 25569;
const date = new Date(offsetDay * 86400000);

const adjustValue = offsetDay >= 0 ? 1 : -1;
const oldDateTimezoneOffset = _getTimezoneOffset(date);
const ms =
(oadate * 86400000 * 1440 +
adjustValue -
25569 * 86400000 * 1440 +
oldDateTimezoneOffset * 86400000) /
1440;
let firstResult = new Date(ms);

const fixHourSign = oldDateTimezoneOffset >= 0 ? 1 : -1;
const nextHour = new Date(ms + fixHourSign * 3600000);
const nextHourTimezoneOffset = _getTimezoneOffset(nextHour);
if (oldDateTimezoneOffset !== nextHourTimezoneOffset) {
let newResult = new Date(
ms + (nextHourTimezoneOffset - oldDateTimezoneOffset) * 60 * 1000
);
if (oldDateTimezoneOffset > nextHourTimezoneOffset) {
if (
fixHourSign === -1 ||
nextHourTimezoneOffset === _getTimezoneOffset(firstResult)
) {
newResult =
newResult.getMilliseconds() === 999
? new Date(newResult.valueOf() + 1)
: newResult;
return newResult;
}
} else if (oldDateTimezoneOffset < nextHourTimezoneOffset) {
if (
fixHourSign === 1 ||
nextHourTimezoneOffset === _getTimezoneOffset(firstResult)
) {
newResult =
newResult.getMilliseconds() === 999
? new Date(newResult.valueOf() + 1)
: newResult;
return newResult;
}
}
}

firstResult =
firstResult.getMilliseconds() === 999
? new Date(firstResult.valueOf() + 1)
: firstResult;
return firstResult;
}

function convertOADate(OAdate) {
return _fromOADate(OAdate).toLocaleDateString();
}

convertOADate(44769);
// '2022/7/27'

Seat management

Due to the peculiarities of the seat management API, for security reasons, you need to append the field when generating the signature"scope": "license".

Get a list of users and seat status

The address of the request

GET http(s)://shimo-domain/sdk/v2/api/license/users

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method
Querypagenumber1beRequest page number
Querysizenumber30beThe number of users returned in a single page

Sample request

curl --location --request GET 'https://shimo-domain/sdk/v2/api/license/users?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString&page=1&size=30'

HTTP Response Body

Example of a response body:

[
{
"userId": "1",
"createdAt": "2021-05-20T14:56:53+08:00",
"status": 1
}
]
The name of the fieldtypeExamples of valuesillustrate
userIdstring1User ID
createdAtstring2021-05-20T14 56:53+08:00Creation time
statusnumber1Seat status
: 1, Active
, 0,
Disabled, -1, Not enabled

User Status Description

status description is not enabled

未启用 When will the state exist?

If the accessor has integrated and implemented at 人related functions, when calling the accessor's search interface, the users who are not associated in the Graphite SDK may be returned, and because such users need to be displayed in the at drop-down list in the graphite editor, the Graphite SDK will first establish a user association, and the user's status will be initialized as未启用 the state, which is the 不会占用 number of seats.

未启用 The status is automatically activated

When a user is not enabled, it will be automatically activated and become a state when the following operations are performed through this user identity, 激活 and the corresponding seat will be occupied at this time, and if the seat is insufficient, access will be denied

  • Create a file
  • Create a copy
  • Visit the edit page
  • Import and export files
  • Preview the file
  • Invoke the API for manipulating the contents of a table
  • Get the historical information and version information of the file sidebar
  • Get the plain text information of the file
  • Get a list of files at people
  • Get file comment data :::

Activate user seats

The address of the request

POST http(s)://shimo-domain/sdk/v2/api/license/users/activate

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

Example of a request body:

The name of the fieldtypeExamples of valuesRequiredillustrate
userIds[]string["1", "2"]beA list of user IDs that need to be activated for the seat

Sample request

curl --location --request POST 'https://shimo-domain/sdk/v2/api/license/users/activate?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--header 'Content-Type: application/json' \
--data-raw '{"userIds":["1","2"]}'

HTTP Response Body

empty

HTTP status code

Status codeillustrate
204The operation was successful

Cancel the user's seat

The address of the request

POST http(s)://shimo-domain/sdk/v2/api/license/users/deactivate

HTTP Request Parameters

Parameter transfer methodThe name of the parametertypeExamples of valuesRequiredillustrate
QueryappIdstringebc1cde3-9b57-4962-883d-54302d428600beAccess the AppId obtained by the service provider from graphite
QuerytokenstringeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9beThe token provided by the access service provider will be passed as a value in the HTTP Headers X-Shimo-Token when Graphite requests the interface of the access service provider
QuerysignaturestringRefer to the section on how to sign thembeAccess the service provider, and use the AppId and AppSecret obtained from graphite to generate the string according to the signature method

HTTP Request Body

Example of a request body:

The name of the fieldtypeExamples of valuesRequiredillustrate
userIds[]string["1", "2"]beA list of user IDs that need to be deseated

Sample request

curl --location --request POST 'https://shimo-domain/sdk/v2/api/license/users/deactivate?appId=yourShimoAppId&signature=yourSignatureString&token=yourTokenString' \
--header 'Content-Type: application/json' \
--data-raw '{"userIds":["1","2"]}'

HTTP Response Body

empty

HTTP status code

Status codeillustrate
204The operation was successful