• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
ZH爱丽丝梦游仙境
 

ZH爱丽丝梦游仙境

on

  • 136 views

Взять быка за рога

Взять быка за рога

Statistics

Views

Total Views
136
Views on SlideShare
136
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    ZH爱丽丝梦游仙境 ZH爱丽丝梦游仙境 Document Transcript

    • WS Partner v1.6 - Access APIWS Partner v1.6 Access API ● repository/properties ● repository/list ● repository/copy ● repository/replace ● repository/download ● repository/rename ● repository/delete ● repository/createfolder ● repository/move ● repository/searchAll WS Partner v1.6 APIs ● WS Partner v1.6 - Access API ● WS Partner v1.6 - Auth API ● WS Partner v1.6 - File Upload API ● WS Partner v1.6 - Mailer API ● WS Partner v1.6 - Preview API ● WS Partner v1.6 - Publisher API ● WS Partner v1.6 - Server Configuration ● WS Partner v1.6 - Service APIback to summaryrepository/propertiesReturns properties of a file or folder in the repository.SignaturePOST http://<servername>/repository/propertiesAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>Using a file or folder id:
    • body{ "id" : "myDocumentOrFolderId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ"} ● id : A file or folder id. ● account_access : The account access string given during service authorization.Using an account id to get properties on the root folder:body{ "service_id":"serviceId", "account_id":"accountId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ"} ●service_id : The repository service identifier. ●account_id : The account identifier. ●account_access : The account access string given during service authorization.repository/properties call successfulHTTP Status Code200 OKbody
    • { "id" : "folderOrFileId", "type" :"application/directory", "size" : ...}List of attributes which can be found in a response.Note that only the id and type attributes are non-optional ● id : The reference to the file/folder required ● type : The mime type of the attachment required. See Mimetypes for list of possible values ● created : The date and time when file/folder was created optional ● modified : The date and time when file/folder was modified optional ● comment : Description or note associated to the file/folder optional ● name : The name of the file/folder optional ● parents : List of parent IDs optional ● owner : The file/folder owner or author optional ● size : The size of the attachment (in bytes) optional ● favorite : true or false optional ● hidden : true or false optional ● viewed : true or false optional ● draft : true or false optional ● privacy : public or private optional. Note that future version may support more possible values. ● tags : A json formated array of text strings optional. ● restrictions : List of restrictions. Possible values are no_delete, no_write, no_rename, no_read, write_locked, no_trash, no_move, no_copy optional ○ no_read : file cant be downloaded (nor moved/copied), list cant be returned for a folder. ○ no_delete : file or folder cant be deleted (nor moved) ○ no_write : file cant be overwritten, folder cant have items added ○ no_rename : item cant be renamed
    • ○ write_locked : file cant be overwritten, folder cant have items added but only temporarily, the file/folder might become available for write soon. ○ no_addfolder : cant add subfolder to current folder. ○ no_trash : file or folder cant be trashed. ○ no_move : folder cant be moved to current folder. ○ no_copy : folder cant be copied to current folder. If no_move or no_copy restrictions are not present, it doesnt mean that a folder can be copied from the repository to another repository. When available, copy/move are only within the same repository. ● icon : Contains a url entry to an absolute path to the icon (for example http://host/res/icon/idisk). To download the icon, the client can simply call a GET on the URL. The call supports "if- modified-since" and "last-modified" header for optimization. See w3c specs optionalIf an attribute is indicated as optional, it means that the entry may notappear and you can consider its value to be nil or the entry mayappear but its value might be empty.Date are formatted in Iso8601.repository/listListing a folderReturns the content of a folder.signaturePOST http://<servername>/repository/listAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body{ "id":"folderId",
    • "next": "VIBJ78didhw28923kjwndkw298323", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ"} ●id : The folder identifier. ●next : Optional The key to retrieve more results when multiple calls are required to get the full list. A first call to repository/folderlist may not return the complete list of items, if the response to a call returns a next attribute, a subsequent call is required to get more results. Use the value of the next attribute from the response to set the next parameter to a new call to repository/folderlist. When there is no more next attribute in a response it means that there is no more results. Even if the response contains a next attribute, it is possible that when calling the operation again using the next value the new response may be empty (with no element in the response). ● account_access : The account access string given during service authorization.Folder listing Response - Success, exampleHTTP Status Code200 OKbody{ "items": [ { "type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "size": "28589", "name": ";)$@@);.xlsx", "id": "idisk://me.com/quickoffice/%3B)%24%40%40)%3B.xlsx",
    • "lastmodified": "2010-01-25T09:16:42Z" }, { "type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "size": "24988", "name": ";)$@@);2.docx", "id": "idisk://me.com/quickoffice/%3B)%24%40%40)%3B2.docx", "lastmodified": "2009-12-28T14:29:39Z" }, { "type": "application/directory", "name": "SOMEONE", "id": "idisk://me.com/quickoffice/SOMEONE", "lastmodified": "2009-12-10T16:50:53Z" }, { "type": "application/directory", "name": "About Stack.pdf", "id": "idisk://me.com/quickoffice/About%20Stack.pdf", "lastmodified": "2010-02-17T10:52:03Z" }, {
    • "type": "application/directory", "name": "Where do folders come from.txt", "id": "idisk://me.com/quickoffice/Where%20do%20folders%20come "lastmodified": "2009-12-02T14:55:58Z" }, { "type": "application/vnd.ms-powerpoint", "size": "3001856", "name": "Shuttle.pps", "id": "idisk://me.com/quickoffice/Shuttle.pps", "lastmodified": "2009-08-24T17:45:02Z" }, { "type": "application/directory", "name": "My Documents", "id": "idisk://me.com/quickoffice/My%20Documents", "lastmodified": "2009-08-19T21:30:00Z" }, { "type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "size": "7187", "name": "Untitled23.xlsx",
    • "id": "idisk://me.com/quickoffice/Untitled23.xlsx", "lastmodified": "2009-12-11T10:58:36Z" } ], "next":"aHR0cDovL2RvY3MuZ29vZ2xlLmNvbS9mZWVkcy9kZWlDd242ZTY5MnpBQUFBQ0FHU" }See repository/properties for details on the response attributes ofeach item in the list.repository/copyAdding/copying item to repositorysignaturePOST http://<servername>/repository/copyAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body{ "source": { "id" : "fileOrFolderId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ" }
    • "destination":{ "id" : "folderId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ" }} ●source : The source file or folder. required ●destination : The destination folder. requiredSee repository/properties for details on a successful response.Before copying the folder check if theres no_copy restriction returnedwith the repository/properties operation.HTTP Status code CONFLICT - 409 is returned if the destination folderalready contains an item with the same name.HTTP Status code NOT_FOUND - 404 is returned if the destinationfolder or the source file/folder is not found.repository/replaceReplaces the content of an existing file. Properties from the source filewont be copied to the destination file. The destination file size andmodified date will be changed. Depending on the repository where thedestination file is stored, the creation date of the destination file mightbe changed.signaturePOST http://<servername>/repository/replaceAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body{
    • "source": { "id" : "fileId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ" }, "destination":{ "id" : "fileId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ" }}The destination file is not renamed and its type is not changed. Theoperation will fail if the destination file doesnt already exists. ● source : The file source. required ● destination : The destination file. requiredrepository/downloadGet a URL link to download the content of an existing file. Thisoperation will retrieve the targeted file from the third party service andreturn the URL link when the full file is available for download. Theclient should call this operation only when it really needs to downloadthe file.signaturePOST http://<servername>/repository/downloadAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body
    • { "id":"fileId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ"}id : File to get download link fromOn success, the operation returns a link from which the file binary canbe downloaded from a simple HTTP GET call.repository/download call successfulHTTP Status Code200 OKbody{ "download_url": "https://us-qo-dev-ws-partner-download-files.s3.amazoExpires=1308260896&AWSAccessKeyId=AKIAJ7OO5X77CJ45KFKA&Signature=ZRiYkPFy "expires": "2011-06-16T21:48:16Z", "id": "qostorage://us-qo-dev-ws-partner-download-files.s3.amazonaws.cH4sIAAAAAAAAAB2MQQ6DMAzAftNbijakjUsfE2jQKtqkI2FlvH6Mg0+2PKdMjIXCmPH1x9tur "account_access": "ec83e621-3562-4a20-a944-7b85f4d0e611"} ● download_url: Pre-signed S3 URL the client can use to obtain the file. ● expires: The date/time the pre-signed S3 URL will expire. ● id: The MX servers unique identifier of the resource in S3.
    • ● account_access: The token the client is to use when making the subsequent call to repository/delete after successfully downloading the file.When calling the returned URL with an HTTP Get, if the call fails with aNOT_FOUND HTTP error, the client should attempt to get a new URLotherwise, the client should re-attempt to download from the alreadygiven URL.Once the file has been successfully downloaded the client should callrepository/delete with the id and account_access values from therespository/download response JSON to remove the file from S3.repository/renameRename a file or folder.signaturePOST http://<servername>/repository/renameAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body{ "id":"fileOrFolderId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ", "name": "newName.doc"} ●id : The file or folder Id that will be renamed. required ●name : The new name. requiredSee repository/properties for details on the response.repository/delete
    • signaturePOST http://<servername>/repository/deleteAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body{ "id":"<fileOrFolderId>", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ", "trash":"<trueOrFalse>"} ● id : The file or folder id that will be deleted from the repository. required ● trash : true or false, default is false. May be set to true only if the file or folder supports a trash. See if theres no_trash restriction returned with the repository/properties operation. optionalrepository/createfoldersignaturePOST http://<servername>/repository/createfolderAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body
    • { "id":"destinationFolderId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ", "name" : "folderName"} ●id : The folder Id which will host the new folder required ●name : The new folder name requiredSee repository/properties for details on the response.repository/moveNote that in order to be able to call this operation you need the sourcerepository to support the action download and delete and the targetrepository needs to support add.signaturePOST http://<servername>/repository/moveAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body{ "source": { "id" : "fileOrFolderId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ" },
    • "destination":{ "id" : "folderId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ" }} ●account_access : The account access string given during service authorization for the destination folder. ● source : The source file or folder. required ● destination : The destination folder to where the file will be added. requiredSee repository/properties for details on the response. Beforemoving the folder check if theres no_move restriction returned withthe repository/properties operation.repository/searchsignaturePOST http://<servername>/repository/searchAccept-Language header<en-US>Accept headerapplication/jsonAuthorization headerOAuth <oauth parameters>body{ "id" : "searchedFolderId", "account_access":"QWERTYFVB45678DFGHvbnDFGHJrtyuCVBertgBBNFGHJ", "name": "searchTermInFilenames",
    • "content":"searchTermInContent", "next" : "nextKey"} ● id : the folder to search from ● name : the term to search in filenames. required if content is not set ● content : the term to search in files content. required if name is not set ● next : Optional The key to retrieve more results when multiple calls are required to get the full list. A first call to repository/search may not return the complete list of items, if the response to a call returns a next attribute, a subsequent call is required to get more results. Use the value of the next attribute from the response to set the next parameter to a new call to repository/search. When there is no more next attribute in a response it means that there is no more results. Even if the response contains a next attribute, it is possible that when calling the operation again using the next value the new response may be empty (with no element in the response)The search operation is not available for all repository services. Inaddition some repository services only allow searching based onfilenames or file content, some support both.Prior to using the search operation, the caller must verify that the typeof search the service supports by querying the capabilities of theservice via the service/repositories operation.The availability of the search operation for a repository is describe viathe list of value of the identifier search : ● name: indicates that the service supports searching for filenames ● content: indicates that the service supports searching for contentNote that the search operation is executed by the repository serviceitself and the interpretation of the search term may vary depending onthe service (for example, a service may match the file mice.doc forthe search term mouse while another service may not, a service maymatch only complete words while other may match partial words, aservice may ignore punctuation characters while another does not,etc.)
    • See repository/list for details on the response.