Fxiaoke Developer Manual Fxiaoke Developer Manual
  • APL Development Manual
  • PWC Development Manual
  • OpenAPI Documentation
  • Quick Start
  • API Authorization
  • API Basics
  • OpenAPI
  • SSO Integration
  • Client Development
  • FAQ
  • OpenApi Version V1 (opens new window)
  • 简体中文
  • English
  • Quick Start
  • API Authorization
  • API Basics
  • OpenAPI
  • SSO Integration
  • Client Development
  • FAQ
  • OpenApi Version V1 (opens new window)
  • 简体中文
  • English
  • Quick Start

  • API Authorization

  • API Basics

  • OpenAPI

  • SSO Integration

  • Client Development

    • Integration Guide

    • JavaScript API

      • Container
      • Device
      • Launcher
      • Webview
      • Modal
      • Fxiaoke
        • Media
        • Utilities
      • UI Components

    • FAQ

    Table of Contents

    Fxiaoke Services

    # Address Book

    API Name Description
    service.contact.select Select employees and departments
    service.contact.selectDepartment Select departments
    service.contact.selectUser Select employees
    service.contact.getMembers Get member list
    service.contact.getUsersInfo Get employee information
    service.contact.setMark Follow or unfollow employee
    service.contact.getServiceChannelsInfo Get service account information

    Use FSOpen.util.open API to navigate to "User Profile Page" or "Department Workspace", refer to General.

    # Select People, Departments and Groups from Address Book

    Code Example

    // Select from employee list, department list and group list
    FSOpen.service.contact.select({
        title: 'Select data',
        selectedUsers: ['FSUID_571AA7C41A11BE3D9BA25BDD397AC86E'],
        selectedDepartments: [1001],
        excludedUsers: ['FSUID_643539016707F16000E85ADCC967D12C'],
        excludedDepartments: [1000],
        hasEmail: true,
        hasPhone: true,
        showRecent: true,
        showGroupTab: true,
        showCompanyAll: true,
        onSuccess: function(resp) {
            console.assert(resp.users != null);
            console.assert(resp.departments != null);
            console.assert(resp.groups != null);
        },
        onFail: function(error) {
            alert('Failed to retrieve, error code: ' + error.errorCode);
        }
    });
    
    // Custom user and department list
    FSOpen.service.contact.select({
        scope: 'custom',
        users: [
            'FSUID_571AA7C41A11BE3D9BA25BDD397AC86E',
            'FSUID_643539016707F16000E85ADCC967D12C'
        ],
        departments: [
            1000,
            1001
        ],
        title: 'Select data',
        onSuccess: function(resp) {
            console.assert(resp.users != null);
        },
        onFail: function(error) {
            alert('Failed to retrieve, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.contact.select
    JS Version: 2.0.0
    Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    title String No Title displayed on the selector, default is empty
    scope String No Specifies the selectable scope. Only two options: company or custom. When company, data source is the entire company list; when custom, you can specify the selectable scope through users and departments parameters. Default is company.
    users Array[String] No Used when scope is custom, specifies the selectable user scope
    departments Array[Number] No Used when scope is custom, specifies the selectable department scope
    selectedUsers Array[String] No List of pre-selected user IDs
    selectedDepartments Array[Number] No List of pre-selected department IDs
    selectedGroups Array[String] No List of pre-selected group IDs
    selectedCompanyAll Boolean No Whether "All Company" is pre-selected, only effective when showCompanyAll is true
    showRecent Boolean No Whether to show recent contacts, default is true
    showGroupTab Boolean No Whether to show group tab, default is true
    showCompanyAll Boolean No Whether to show "All Company" option, default is true
    excludedUsers Array[String] No Filter, list of user IDs to exclude from the current scope (refer to scope). Not implemented in js 2.0.0.
    excludedDepartments Array[Number] No Filter, list of department IDs to exclude from the current scope (refer to scope). Not implemented in js 2.0.0.
    hasEmail Boolean No Filter, true means only show users with email. If not specified, all are shown.
    hasPhone Boolean No Filter, true means only show users with phone number. If not specified, all are shown.

    Returns:

    Parameter Type Description
    users Array[Object] List of selected user objects
    departments Array[Object] List of selected department objects
    groups Array[Object] List of selected group objects
    selectedSum Array[Object] Total number of selected people. If departments are selected, people in departments are deduplicated and counted in the total.
    selectedCompanyAll String Is the entire company selected?

    userField Descriptions:

    Parameter Type Description
    userId String User ID
    nickname String User nickname
    email String User email
    avatarUrl String User avatar
    position String User position

    departmentField Descriptions:

    Parameter Type Description
    departmentId Number Department ID
    name String Department Name
    parentId String Parent Department ID

    groupField Descriptions:

    Parameter Type Description
    sessionId String Group (Session) ID
    name String Group (Session) Name

    # Select a department from the address book

    Code Example

    FSOpen.service.contact.selectDepartment({
        title: 'Select data',
        selectedDepartments: [1001],
        excludedDepartments: [1000],
        onSuccess: function(resp) {
            console.assert(resp.departments != null);
        },
        onFail: function(error) {
            alert('Failed to retrieve, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.contact.selectDepartment JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    title String No Title displayed on the selector,defaults to empty
    scope String No Specifies the selectable scope. Only two options: company or custom。When it is company, the data source is the list of company-wide data; when it is custom, the optional range can be specified through the departments parameter. It defaults to company.
    departments Array[Number] No Used when scope is custom, specifies the selectable department scope
    selectedDepartments Array[Number] No List of department IDs in the selected state
    max Number No Maximum selection limit. When max=1, it is a single selection. By default, there is no limit.
    excludedDepartments Array[Number] No Filter, a list of department IDs that need to be excluded from the current setting range (refer to scope)

    Returns:

    Parameter Type Description
    departments Array[Object] List of selected department objects
    selectedSum Array[Object] The total number of all selected people

    departmentField Descriptions:

    Parameter Type Description
    departmentId Number Department ID
    name String Department Name
    parentId String Parent Department ID

    # Select a person from the address book

    Code Example

    FSOpen.service.contact.selectUser({
        title: 'Select data',
        selectedUsers: ['FSUID_571AA7C41A11BE3D9BA25BDD397AC86E'],
        excludedUsers: ['FSUID_643539016707F16000E85ADCC967D12C'],
        hasEmail: true,
        hasPhone: true,
        onSuccess: function(resp) {
            console.assert(resp.users != null);
        },
        onFail: function(error) {
            alert('Failed to retrieve, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.contact.selectUser JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    title String No Title displayed on the selector,defaults to empty
    scope String No Specifies the selectable scope. Only two options: company or custom. When set to company, the data source is the full company user list; when set to custom, the selectable scope can be specified via the users parameter. Defaults to company.
    users Array[String] No Used when scope is custom, specifies the selectable user scope
    selectedUsers Array[String] No List of user IDs in the selected state
    max Number No Maximum selection limit: when max=1, it is a single selection. By default, there is no limit.
    excludedUsers Array[String] No Filter, list of user IDs to exclude from the current scope (refer to scope)
    hasEmail Boolean No Filter, true means only show users with email。if not specified, all are shown。
    hasPhone Boolean No Filter, true means only show users with phone number。if not specified, all are shown。

    Returns:

    Parameter Type Description
    users Array[Object] List of selected user objects
    selectedSum Array[Object] Total number of all selected users

    userField Descriptions:

    Parameter Type Description
    userId String User ID
    nickname String User nickname
    email String User email
    avatarUrl String User avatar
    position String User position

    # Get Member List

    Code Example

    Please note that the 'departmentId' parameter in the example needs to be replaced with a valid value, which may come from the return of another API selectDepartment.

    FSOpen.service.contact.getMembers({
        departmentId: 1000,
        sessionId: 'f6b22ba707bd4447855567291c27476f',
        onSuccess: function(resp) {
            console.assert(resp.userIds.length != undefined);
            FSOpen.service.contact.getUsersInfo({
                userIds: resp.userIds
            });
        },
        onFail: function(error) {
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.contact.getMembers JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    departmentId Number Yes If the query object is a department, pass in the department ID.
    sessionId String Yes If the query object is a group, pass in the group (session) ID. If a valid departmentId is passed, the API will ignore the sessionId parameter.

    Success Callback Returns:

    Parameter Type Description
    userIds Array[String] List of user IDs

    # Get User Information

    Code Example

    FSOpen.service.contact.getUsersInfo({
        userIds: [
            'FSUID_571AA7C41A11BE3D9BA25BDD397AC86E',
            'FSUID_643539016707F16000E85ADCC967D12C'
        ],
        onSuccess: function(resp) {
            console.assert(resp.users != null);
            var users = resp.users, key;
            // Iterate through found users
            for (key in users) {
                // {userId:'',nickname:'',email:'',avatarUrl:'',position:'',marked:true}
                console.log(users[key]);
            }
        },
        onFail: function(error) {
            alert('Failed to retrieve, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.contact.getUsersInfo JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    userIds Array[String] Yes List of user IDs

    Success Callback Returns:

    Parameter Type Description
    users Object Associative array of user objects, for example:{'FSUID_XXX': {userId:'',nickname:'',email:'',avatarUrl:'',position:'',marked:true}},if user not found, the corresponding value is empty

    userField Descriptions:

    Parameter Type Description
    userId String User ID
    nickname String User nickname
    email String User email
    avatarUrl String User avatar
    position String User position
    marked Boolean er to follow this user

    # Follow or Unfollow Employee

    Code Example

    FSOpen.service.contact.setMark({
        userId: 'FSUID_5174F22D77B81347E278CBD353748547',
        value: true,
        onSuccess: function(resp) {
            alert(JSON.stringify(resp));
        },
        onFail: function(error) {
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.contact.setMark JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    userId String Yes FenXiang user ID
    value Boolean Yes Whether to follow

    # Get Service Account Information

    Code Example

    FSOpen.service.contact.getServiceChannelsInfo({
        serviceChannelIds: ['FSAID_1313eef'],
        onSuccess: function(resp) {
            // do sth
        },
        onFail: function(error) {
            alert('Failed to retrieve, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.contact.getServiceChannelsInfo JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    serviceChannelIds Array[String] Yes List of service account IDs

    Success Callback Returns:

    Parameter Type Description
    serviceChannels Object Associative array of serviceChannel objects, for example:{'FSAID_13135e9': {serviceChannelId:'',name:'',imgUrl:''}},if user not found, the corresponding value is empty

    serviceChannelField Descriptions:

    Parameter Type Description
    serviceChannelId String Service account ID
    name String Service account name
    imgUrl String Service account logo URL

    # Enterprise Messaging

    API name Description
    service.conversation.setupFSCall Initiate a 1-on-1 FS call
    service.conversation.setupFSConference Initiate a multi-person FS conference call

    You can jump to the "Enterprise Message Conversation Window" using the FSOpen.util.open interface. For reference, see Util (opens new window).

    # Initiate 1-to-1 FenXiang Call

    Code Example

    FSOpen.service.conversation.setupFSCall({
        userId: ['FSUID_571AA7C41A11BE3D9BA25BDD397AC86E']
    });
    

    Method: FSOpen.service.conversation.setupFSCall JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    userId String Yes User ID

    # Initiate Multi-party FenXiang Conference Call

    Code Example

    FSOpen.service.conversation.setupFSConference({
        userIds: ['FSUID_571AA7C41A11BE3D9BA25BDD397AC86E']
    });
    

    Method: FSOpen.service.conversation.setupFSConference JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    userIds Array[String] Yes List of user IDs

    # Favorite

    API name Description
    service.favorite.add Add to favorites

    You can jump to "My Favorites" using the FSOpen.util.open interface. For reference, see Util (opens new window).

    # Add to favorites

    Code Example

    FSOpen.service.favorite.add({
        title: 'Fxiaoke Open PlatformJSAPI',
        desc: 'Fxiaoke Open PlatformJSAPI',
        link: location.href,
        imgUrl: '',
        tagList: ['FenXiang', 'JSAPI'],
        onSuccess: function(resp) {
            alert('Added to favorites successfully');
        },
        onFail: function(error) {
            if (error.errorCode === 40050) {
                alert('User cancelled adding to favorites');
                return;
            }
            alert('Failed to retrieve, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.favorite.add JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    title String Yes Favorite title
    desc String No Favorite description
    link String No Favorite link, defaults to current page link
    imgUrl String No Thumbnail of favorite content
    tagList Array[String] No Tag list of favorite content

    # Geolocation

    API Name Description
    service.geo.getLocation Get current geolocation
    service.geo.selectPOI Select point of interest

    # Get Current Geolocation

    Code Example

    FSOpen.service.geo.getLocation({
        onSuccess: function(resp) {
            alert('Location info: ' + JSON.stringify(resp));
        },
        onFail: function(error) {
            alert('Operation failed: ' + JSON.stringify(error));
        }
    });
    

    Method: FSOpen.service.geo.getLocation JS Version: 2.0.0 Client Support: 5.4.0 and above

    Returns:

    Parameter Type Description
    accuracy Number Actual location accuracy radius (in meters)
    address String Formatted address, e.g., Dachong Business Center, Nanshan District, Shenzhen
    country String Country
    province String Province, e.g., Guangdong Province
    city String City, e.g., Shenzhen. Returns empty for municipalities
    district String District, e.g., Nanshan District
    street String Street, e.g., No. 10000 Tonggu Road

    # Select Point of Interest

    Code Example

    FSOpen.service.geo.selectPOI({
        latitude: 39.903578,
        longitude: 116.473565,
        onSuccess: function(resp) {
            alert('Location info: ' + JSON.stringify(resp));
        },
        onFail: function(error) {
            alert('Operation failed: ' + JSON.stringify(error));
        }
    });
    

    Method: FSOpen.service.geo.selectPOI JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    latitude Number No Latitude,defaults to current location
    longitude Number No Longitude,defaults to current location

    Returns:

    Parameter Type Description
    latitude Number POI latitude
    longitude Number POI longitude
    title String POI name
    province String POI province, may be empty
    provinceCode String POI province code, may be empty
    city String POI city, may be empty
    cityCode String POI city code, may be empty
    district String POI district, may be empty
    districtCode String POI district code, may be empty
    postcode String POI postcode, may be empty
    street String POI street address, may be empty

    # Sharing

    These APIs correspond to sharing options in FenXiang menu and can be used independently.

    API Name Description
    service.share.toConversation Share to enterprise messaging
    service.share.toFeed Share to workspace
    service.share.toCRMContact Share to CRM contact
    service.share.toWXFriend Share to WeChat friend
    service.share.toWXMoments Share to WeChat Moments
    service.share.toQQFriend Share to QQ friend
    service.share.viaSMS Share via SMS
    service.share.viaEmail Share via email

    # Share to Enterprise Messaging

    Code Example

    FSOpen.service.share.toConversation({
        title: '纷享逍客',
        desc: '移动办公 自在纷享',
        link: 'http://www.fxiaoke.com',
        imgUrl: 'https://www.fxiaoke.com/static/img/index/logo.png?v=5.1.5',
        onSuccess: function(resp) {
            // You can do some share data statistics here
            alert('Shared successfully');
        },
        onFail: function(error) {
            if (error.errorCode == 40050) {
                alert('User cancelled sharing');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.share.toConversation JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    type String No Shared resource type. Currently supports text-Text, link-Link, image-Image, file-File. When link parameter is empty, defaults to text type, otherwise defaults to link type.
    title String No Used when resource type is link, represents share title, defaults to current page title
    desc String No Used when resource type is link, represents share description, defaults to current page description (<meta name="description" content="webpage description here"> tag content), if unavailable, displays page URL.
    link String No Used when resource type is link, represents share link URL, defaults to current page URL
    imgUrl String No Used when resource type is link, represents share thumbnail URL, defaults to FenXiang preset icon
    name String No Used when resource type is image or file, represents resource name
    size String No Used when resource type is image or file, represents resource size
    npath String No Used when resource type is image or file, represents resource storage address. Resource must be stored on FenXiang platform, referenced using N-Path address, e.g., N_201512_08_101239c8308f4ea7325f69df4fba386f1.pptx.
    content String No Used when resource type is text, represents file content

    # Share to Workspace Stream

    Code Example

    FSOpen.service.share.toFeed({
        title: '纷享逍客',
        desc: '移动办公 自在纷享',
        link: 'http://www.fxiaoke.com',
        imgUrl: 'https://www.fxiaoke.com/static/img/index/logo.png?v=5.1.5',
        onSuccess: function(resp) {
            // You can do some share data statistics here
            alert('Shared successfully');
        },
        onFail: function(error) {
            if (error.errorCode == 40050) {
                alert('User cancelled sharing');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.share.toFeed JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    type String No Shared resource type. Currently supports text-Text, link-Link, image-Image, file-File. When link parameter is empty, defaults to text type, otherwise defaults to link type.
    title String No Used when resource type is link, represents share title, defaults to current page title
    desc String No Used when resource type is link, represents share description, defaults to current page description (<meta name="description" content="webpage description here"> tag content), if unavailable, displays page URL.
    link String No Used when resource type is link, represents share link URL, defaults to current page URL
    imgUrl String No Used when resource type is link, represents share thumbnail URL, defaults to FenXiang preset icon
    name String No Used when resource type is image or file, represents resource name
    size String No Used when resource type is image or file, represents resource size, in kb.
    npath String No Used when resource type is image or file, represents resource storage address. Resource must be stored on FenXiang platform, referenced using N-Path address, e.g., N_201512_08_101239c8308f4ea7325f69df4fba386f1.pptx.
    content String No Used when resource type is text, represents file content

    # Share to CRM Contact

    Code Example

    FSOpen.service.share.toCRMContact({
        link: location.href,
        onSuccess: function(resp) {
            // You can do some share data statistics here
            alert('Shared successfully');
        },
        onFail: function(error) {
            if (error.errorCode == 40050) {
                alert('User cancelled sharing');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.share.toCRMContact JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    link String No Page link to share

    # Share to WeChat Friend

    Code Example

    FSOpen.service.share.toWXFriend({
        title: '纷享逍客',
        link: 'http://www.fxiaoke.com',
        imgUrl: 'https://www.fxiaoke.com/static/img/index/logo.png?v=5.1.5',
        onSuccess: function(resp) {
            // You can do some share data statistics here
            alert('Shared successfully');
        },
        onFail: function(error) {
            if (error.errorCode == 40050) {
                alert('User cancelled sharing');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.share.toWXFriend JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    title String No Share title,defaults to current page title
    link String No Share link URL,defaults to current page URL
    imgUrl String No Share thumbnail URL,defaults to FenXiang preset icon

    # Share to WeChat Moments

    Code Example

    FSOpen.service.share.toWXMoments({
        title: '纷享逍客',
        link: 'http://www.fxiaoke.com',
        imgUrl: 'https://www.fxiaoke.com/static/img/index/logo.png?v=5.1.5',
        onSuccess: function(resp) {
            // You can do some share data statistics here
            alert('Shared successfully');
        },
        onFail: function(error) {
            if (error.errorCode == 40050) {
                alert('User cancelled sharing');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.share.toWXMoments JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    title String No Share title,defaults to current page title
    link String No Share link URL,defaults to current page URL
    imgUrl String No Share thumbnail URL,defaults to FenXiang preset icon

    # Share to QQ Friend

    Code Example

    FSOpen.service.share.toQQFriend({
        title: '纷享逍客',
        desc: '移动办公 自在纷享',
        link: 'http://www.fxiaoke.com',
        imgUrl: 'https://www.fxiaoke.com/static/img/index/logo.png?v=5.1.5',
        onSuccess: function(resp) {
            // You can do some share data statistics here
            alert('Shared successfully');
        },
        onFail: function(error) {
            if (error.errorCode == 40050) {
                alert('User cancelled sharing');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.share.toQQFriend JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    title String No Share title,defaults to current page title
    desc String No Share description,defaults to current page description(<meta name="description" content="webpage description here"> tag content),if unavailable, displays page URL。
    link String No Share link URL,defaults to current page URL
    imgUrl String No Share thumbnail URL,defaults to FenXiang preset icon

    # Share via SMS

    Code Example

    FSOpen.service.share.viaSMS({
        content: '移动办公,自在纷享 {url}',
        onSuccess: function(resp) {
            // You can do some share data statistics here
            alert('Shared successfully');
        },
        onFail: function(error) {
            if (error.errorCode == 40050) {
                alert('User cancelled sharing');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.share.viaSMS JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    content String No Forward content, maximum 140 characters, use {url} placeholder to represent current page URL

    # Share via Email

    Code Example

    FSOpen.service.share.viaMail({
        title: '纷享逍客',
        content: '移动办公,自在纷享 {url}',
        onSuccess: function(resp) {
            // You can do some share data statistics here
            alert('Shared successfully');
        },
        onFail: function(error) {
            if (error.errorCode == 40050) {
                alert('User cancelled sharing');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.share.viaMail JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    title String No Email title for forwarding
    content String No Email content for forwarding. Use {url} (5 characters) to represent current page URL, the backend will replace it in the final content.

    # Calendar

    API Name Description
    service.calendar.createEvent Create events

    You can jump to "Calendar" using the FSOpen.util.open interface. For reference, see Util (opens new window).

    # Create Schedule Reminder

    Code Example

    FSOpen.service.calendar.createEvent({
        content: 'Remember to work today',
        onSuccess: function(resp) {
            alert('Created successfully');
        },
        onFail: function(error) {
            alert('Failed to create, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.calendar.createEvent JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    content String No Schedule reminder content

    # Workspace

    API Name Description
    service.feed.create Create workspace post

    You can jump to "Work Details" using the FSOpen.util.open interface. For reference, see Util (opens new window).

    # Create Workspace Post

    Code Example

    FSOpen.service.feed.create({
        type: 'share',
        content: 'Deployment on Friday',
        onSuccess: function(resp) {
            alert('Created successfully');
        },
        onFail: function(error) {
            alert('Failed to create, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.feed.create JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    type String No Workspace post type: share-Share, diary-Log, approval-Approval, task-Task, schedule-Schedule, order-Directive,if not specified, user can choose
    content String No For work text content, except for tasks, all are assigned to the first field of each type of work by default. For example, daily reports are filled in the "Today's Work" field; tasks are filled in the second field "Remarks".

    # Cloud Storage

    API Name Description
    service.disk.addFile Save file to cloud storage
    service.disk.selectFile Select file from cloud storage

    # Save File to Cloud Storage

    FSOpen.service.disk.addFile({
        fileName: '纷享逍客培训.pptx',
        fileNPath: 'N_201606_29_f13bbed15ba14413bc0aef29be255817.pptx',
        onSuccess: function(resp) {
            alert('Saved successfully');
        },
        onFail: function(error) {
            alert('Failed to save, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.disk.addFile JS Version: 2.0.0 Client Support: 5.4.0 and above

    Parameters:

    Parameter Type Required Description
    fileName String Yes Storage file name, must include file extension
    fileNPath String Yes File URL。Resource must be stored on FenXiang platform, referenced using N-Path address, e.g., N_201512_08_101239c8308f4ea7325f69df4fba386f1.pptx。

    # Select File from Cloud Storage

    Code Example

    FSOpen.service.disk.selectFile({
        onSuccess: function(resp) {
            alert('File info: ' + JSON.stringify(resp));
        },
        onFail: function(error) {
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.service.disk.selectFile JS Version: 2.0.0 Client Support: 5.4.0 and above

    Success Callback Returns:

    Parameter Type Description
    file Object File information

    fileField Descriptions:

    Parameter Type Description
    id String File ID
    fileName String File name
    fileNPath String File URL. Resource must be stored on FenXiang platform, referenced using N-Path address, e.g., N_201512_08_101239c8308f4ea7325f69df4fba386f1.pptx.
    size Number File size, in bytes
    url String File URL accessible via HTTP connection
    Modal
    Media

    ← Modal Media →

    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式