Mail API Overview

    The LINE WORKS Mail API (hereinafter, the "Mail API" or "API") is an HTTP-based REST API which returns most of results in JSON format (responses of popup windows to write or read messages or to open external contacts are not formatted as JSON) and uses OAuth 2.0 for authentication.

    The Mail API allows you to programmatically use the common features of LINE WORKS Mail Service.

    API Common Information

    Supported Environment

    LINE WORKS supports two types of environments: testing and live. However, the Mail API is available only in the live environment.

    • Live environment: https://apis.worksmobile.com

    Combine an HTTP method with the request URL to complete an operation. For example, here is the operation to send a message in the live environment.

    Example) Operation for sending a message

    POST https://apis.worksmobile.com/r/{API ID}/mail/v2/sendMail
    

    You can see a request URL for each API call in the corresponding API details section.

    Request - Common Information

    With each API call, you should include a LINE WORKS token and a consumer key in the request header. You can get a token when you log in to the LINE WORKS system; it is re-issued every time you log in to the system.

    For how to get a consumer key, see API Common Guide.

    The code below shows how to set a LINE WORKS token and a consumer key in the request header.

    httpMethod.setRequestHeader("Authorization", "Bearer Access Token");
    httpMethod.setRequestHeader("consumerKey", "consumer key");