Compose Document Using Form Generator v2
    • PDF

    Compose Document Using Form Generator v2

    • PDF

    Article Summary

    Description

    It uses an API to create a document in a form created by the form generator.

    Request URL

    POST https://workplace.apigw.ntruss.com/workflow/apigw/v2/company/{companyId}/fg/{dfmId}/doc
    

    Request Header

    HeaderDescription
    x-ncp-apigw-timestamp
  • It indicates the time elapsed since January 1, 1970 00:00:00 (UTC) in milliseconds.
  • If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.
  • x-ncp-iam-access-keyAccess key ID issued on the NAVER Cloud Platform portal or by Sub Account
    x-ncp-apigw-signature-v2
  • Signature used to encrypt the body of the above example with the secret key that maps with the access key ID.
  • HmacSHA256 is used for the HMAC encryption algorithm.
  • Request Path Parameters

    ParameterTypeSizeRequirement statusDescription
    companyIdString36YIntegration key (companyId) Developers > Basic settings > Integration key
    dfmIdString36YForm ID



    Request Body Parameters

    ParameterTypeSizeRequirement statusDescription
    titleString1000YSubject
    dfmIdString36YForm ID
    trgtCompanyIdString36YRequestor's company ID
    trgtExternalKeyString36YRequestor ID - External key - Requires one from among WORKPLACE employee ID, external key, and login ID
    trgtUserIdString36YRequestor WORKPLACE ID - Requires one from among WORKPLACE employee ID, external key, and login ID
    trgtLoginIdString36YRequestor login ID - Requires one from among WORKPLACE employee ID, external key, and login ID
    trgtDeptExternalKeyString36YRequestor department code - External key - Requires a WORKPLACE department code or external key
    trgtDeptCdString36YRequestor department code - Requires a WORKPLACE department code or external key
    proxyYnString1YProxy request status- Default: N- If the applicant and the creator are different, enter Y and enter creator information. If the applicant and the creator are the same, the status is changed to N.- Write the item starting with drft shown below.
    drftCompanyIdString36NCreator's company ID
    drftExternalKeyString36NCreator ID - External key - Requires one from among WORKPLACE employee ID, external key, and login ID
    drftUserIdString36NCreator WORKPLACE ID - Requires one from among WORKPLACE employee ID, external key, and login ID
    drftLoginIdString36NCreator login ID - Requires one from among WORKPLACE employee ID, external key, and login ID
    drftDeptExternalKeyString36NCreator department code - External key - Requires a WORKPLACE department code or external key
    drftDeptCdString36YCreator department code - Requires a WORKPLACE department code or external key
    aprvLineMngYnString1YManage Approval Line use status - Default: Y - Uses the approval line registered in Manage Approval Line.- Only head of superordinate department, manual input, or workplace manager can be used for Manage Approval Line. Reports To is only available when all employees have one person for Reports To.
    aprvLineListListNApproval line - If Manage Approval Line use status is N, then enter the approval line. - If there is no approval line, then the document is completed immediately upon saving.- Approval line details
    shreUsersMngYnString1YManage Shared Recipient use status - Default: Y - Uses shared recipient registered in Manage Shared Recipient. If N, then check the item related to share below.
    shreTpCdString20YSharing option code - If Manage Shared Recipient use status is N, then this information is required.- allShre: share with all (If Sharing target code is comp, enter it as share with all.)- partShre: partially share (If there is no shared recipient, enter it as partially share and do not enter the sharing target information (shreUsersList).)
    shreTimeTpCdString20YSharing time - If Manage Shared Recipient use status is N, then this information is required.- anyTime- cmpltTime
    shreUserListListNSharing target information - If Manage Shared Recipient use status is N, enter the corporate ID when the sharing option is allShre, and enter according to the sharing recipient status when it is partShre. - Shared recipient details
    dataListListYComponent data configured in the form body - Component dataList parameter



    Approval Line Details

    ParameterTypeSizeRequirement statusDescription
    aprvOrdintYApproval order (starting from 1)
    aprvParallelGrpintYApproval parallel group (same value for same group) (if not parallel, 0)
    aprvParallelDtlGrpintYSequential group within the approval parallel group (if not parallel, 0)
    aprvParallelDtlOrdintYSequential order within the approval parallel group (if not parallel, 0)
    aprvTpCdString36YApproval type code- aprv Approval- refer Reference- agree Agreement- parallelAprv Parallel approval- parallelAgree Parallel agreement
    aprvCompanyIdString36YApprover's company ID
    aprvExternalKeyString36YApprover ID - External key - Requires one from among WORKPLACE employee ID, external key, and login ID
    aprvUserIdString36YApprover WORKPLACE ID - Requires one from among WORKPLACE employee ID, external key, and login ID
    aprvLoginIdString36YApprover login ID - Requires one from among WORKPLACE employee ID, external key, and login ID
    aprvDeptExternalKeyString50NApprover department code - External key - Requires a WORKPLACE department code or external key
    aprvDeptCdString50NApprover department code - Requires a WORKPLACE department code or external key
    defaultYnString1NDefault approval line status - If Y, then this can't be edited or deleted if the user sets an approval line.



    Shared Recipient Details

    ParameterTypeSizeRequirement statusDescription
    shreObjectTpCdString50YSharing target code- user: employee- comp: company
    shreCompanyIdString36YCompany ID of shared recipient- Sharing target code: If user, company ID of shared recipient- Sharing target code: If comp, company ID to share with.
    shreUserIdString36YWORKPLACE ID of shared recipient- Sharing target code: If user, then this requires a WORKPLACE employee ID, external key, or login ID.
    shreExternalKeyString36YExternal key of shared recipient- Sharing target code: If user, then this requires a WORKPLACE employee ID, external key, or login ID.
    shreLoginIdString36YShared recipient login ID- Sharing target code: If user, then this requires a WORKPLACE employee ID, external key, or login ID.
    shreDeptExternalKeyString50YShared recipient department code - External key - Sharing target code: If user, this requires a WORKPLACE department code or external key.
    shreDeptCdString50YShared recipient department code - Sharing target code: If user, this requires a WORKPLACE department code or external key.



    Component dataList Parameter

    Component UUID can be searched through Approval > View Form > View Form Details API.

    1. Basic Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentValueString1000YComponent value

    Supported component types

    • [Text] component (CP_TEXT)
    • [Multi-text] component (CP_MULTI_TEXT)
    • [Number] component (CP_NUMBER)
    • [Smart Editor] component (CP_EDITOR)
    • [Automatically displayed text] component (CP_HIDDEN_TEXT)
    • [Instruction text] component (CP_GUIDE)
    • [Image] component (CP_IMG_STATIC)
    • [Automatic number issuance] component (CP_AUTO_GENENUM)
    • [Division line] component (CP_SECTION_LINE)
    Note
    • [Instruction text] component
      • "Form Generator > Instruction Text > Detailed Settings > Printed Content Settings" value is automatically displayed.
    • [Image] component
      • The attached image is automatically displayed in "Form Generator > Image > Detailed Settings > Image Settings."
    • [Automatic number issuance] component
      • The set number is automatically displayed in "Form Generator > Automatic Number Issuance > Detailed Settings."
    • [Division line] component
      • The division line is automatically displayed.
    Note
    • [Automatically printed text] component
      • It is available only if "Form Generator > Automatically Printed Text > Detailed Settings > API Integration" option is selected.
        • Other options provided by the form generator aren't available.
      • When requesting the API, the text entered in the componentValue field is saved and not displayed on the page.
      • You can insert the "internal code" information that is not displayed on the page in the document using the component.

    2. Table Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentHeaderString1000YComponent header
    componentBodyListYComponent body
    componentHeaderTypeSizeRequirement statusDescription
    cellUuidString36YHeader cell UUID
    cellNameString36YHeader cell name
    cellTypeString36YHeader cell data type
    componentBodyTypeSizeRequirement statusDescription
    cellUuidString36YData cell UUID
    cellValueString36YData cell value

    Supported component types

    • [Table] component (CP_TABLE_FORM)

    3. Formula Table Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentHeaderString1000YComponent header
    componentBodyListYComponent body
    componentHeaderTypeSizeRequirement statusDescription
    cellUuidString36YHeader cell UUID
    cellNameString36YHeader cell name
    cellTypeString36YHeader cell data type
    cellModeString36YHeader cell mode (data, calculation)
    componentBodyTypeSizeRequirement statusDescription
    cellUuidString36YData cell UUID
    cellValueString36YData cell value

    Supported component types

    • [Formula table] component (CP_TABLE_FORM_CAL)
    Note
    • Header cell mode (cellMode)
      • Sets the data by default
      • Sets the calculation for the calculation formula column
    • For the calculation formula column, the cellValue value of the data cell doesn't need to be entered. (It's automatically calculated internally.)

    4. File Attachment Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentAttachFileListYComponent value
    componentAttachFileTypeSizeRequirement statusDescription
    fileIdString36YAttachment file ID

    Supported component types

    • [File attachment] component (CP_ATTACH_FILE)
    Note
    • To check the fileId, Common > File Attachment > Upload API must be called first.
    • The file attachment component can be used only if the file upload task succeeds first.

    5. Image Attachment Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentImageFileListYComponent value
    componentAttachFileTypeSizeRequirement statusDescription
    fileIdString36YAttachment file ID

    Supported component types.

    • [Image attachment] component (CP_IMG)
    Note
    • To check the fileId, Common > File Attachment > Upload API must be called first.
    • The file attachment component can be used only if the file upload task succeeds first.
    • You can only use image files.

    6. Components That Requires Item Selection

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentSelectedItemListYComponent value
    componentSelectedItemTypeSizeRequirement statusDescription
    selectedItemIdString36YItem UUID
    selectedItemNmString256YItem name

    Supported component types

    • [Select box] component (CP_SELECTBOX)
    • [Multi-select box] component (CP_MULTI_SELECTBOX)
    • [Checkbox] component (CP_CHECKBOX)
    • [Radio button] component (CP_RADIO)
    Note
    • When creating a document, the item name is displayed as the text defined in the form generator.
    • Depending on the component type and options, it can be single or multiple item selection.
    Note
    • [Select box] component
      • You can select "Form Generator > Select Box > Detailed Settings > Integration Code" option.
      • In this case, you need to check [Detailed code] of the registered integration code from the Manage Approval > Manage Integration Code page and enter it as a value for the integration code.
      • The integration code list can be changed in real time according to the integration code admin's settings.

    7. Date Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentDateValueObjectYComponent value
    componentDateValueTypeSizeRequirement statusDescription
    dayString256YDate (single)
    startDayString256YDate (range) start date
    endDayString256YDate (range) end date

    Supported component types

    • [Date (single)] component (CP_DATE)
    • [Date (range)] component (CP_RANGE_DATE)
    Note
    • Date (single) component
      • Only the day attribute should be used as a parameter.
    • Date (range) component
      • Only the startDay and endDay attributes should be used as parameters.
    • You need to follow the format for the date data.
      • <Example> 2022.09.08

    8. Time Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentTimeValueObjectYComponent value
    componentTimeValueTypeSizeRequirement statusDescription
    timeString256YTime (single)
    startTimeString256YTime (range) start time
    endTimeString256YTime (range) end time

    Supported component types

    • [Time (single)] component (CP_TIME)
    • [Time (range)] component (CP_RANGE_TIME)
    Note
    • Time (single) component
      • Only the time attribute should be used as a parameter.
    • Time (range) component
      • Only the startTime and endTime attributes should be used as parameters.
    • You need to follow the format for the time data.
      • <Example> 15:00

    9. Address Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentAddrValueObjectYComponent value
    componentAddrValueTypeSizeRequirement statusDescription
    krPostString256YZip code
    krAddr1String256YAddress
    krAddr2String256YDetailed address

    Supported component types

    • [Address] component (CP_ADDR_KR)

    10. Related Document Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentRelDocListYComponent value
    componentRelDocTypeSizeRequirement statusDescription
    aprvDocIdString36YApproval ID
    docTypeString36YDocument type (General document: NM)

    Supported component types

    • [Related document] component (WCP_WP_DOC)
    Note
    • To check the aprvDocId, Approval > View Document List API must be called first.
    • Currently, only general documents are supported.

    11. Search Employees Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentEmpListYComponent value
    componentEmpTypeSizeRequirement statusDescription
    empIdString36YEmployee ID

    Supported component types

    • [Search employees] component (WCP_SEARCH_EMP)
    Note

    To check the empId, Member > View Employee API must be called first.

    12. Search Department Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentDeptValueListYComponent value
    componentDeptValueTypeSizeRequirement statusDescription
    allbooleanYWhether all departments are searched (All: true, Default: false)
    deptListListYDepartment Information
    deptListTypeSizeRequirement statusDescription
    deptNoString36YDepartment ID

    Supported component types

    • [Search department] component (WCP_SEARCH_DEPT)
    Note

    To check the deptNo, Member > View Organization API must be called first.

    13. Currency Components

    Item parameterTypeSizeRequirement statusDescription
    componentUuidString36YComponent UUID
    componentCodeString36YComponent type code
    componentCurrencyValueListYComponent value
    componentCurrencyValueTypeSizeRequirement statusDescription
    value36StringYCurrency value
    code36StringNCurrency code

    Supported component types

    • [Currency] component (CP_CURRENCY)
    Note
    • If the "Currency settings" option is used in the form generator, then the "currency code" is ignored. (The currency code set in the form is used.)
    • If the "Do not set currency" option is used, then the "currency code" is required.
    • If the "Allow decimal point input" option is used in the form generator, then the "currency value" must follow the set number of decimal points.
    • Currency value input when decimal points are not used
      • <Example> 10000
    • Currency value input when decimal points are used
      • <Example> 10000.00



    Response

    It is returned as an HTTP status code and delivered as body information.

    HTTP status codeResponse messageDescription
    200OKGeneral successful request
    201CreatedResponse code for successful resource creation
    400Bad RequestUsed for general request failure
    500Internal Server Error
  • Response code for general server error
  • 4xx error codes are used to represent client-side errors.
  • 5xx error codes are used to represent server-side errors.


  • Response Details

    After checking the consistency of component input items, error codes and error messages are delivered for errors.

    Error codeError message
    3000Required fields are not entered.
    3001The user doesn't exist.
    3002The department doesn't exist.
    3003The component value doesn't exist.
    3004It doesn't match the number of components in the form.
    3005The component UUID doesn't exist.
    3006The component property doesn't exist.
    3007The max number of characters that can be entered has been exceeded.
    3008Only one component value can be used.
    3009The component format doesn't match.
    3010The max number of files that can be attached has been exceeded.
    3011The max size of files that can be attached has been exceeded.
    3012This file has already been uploaded.
    3013This file extension is not allowed.
    3014Multiple selections are not available.
    3015Selection of all items is not available.
    3016The document information doesn't match.
    3016The document information doesn't match.
    3017The table column data is invalid.
    3018Required properties for API creation hasn't been set.
    3999Internal error has occurred in Approval.

    Response Examples

    HTTP/1.1 200 OK
    Server: nginx
    Date: Wed, 12 Sep 2020 01:18:11 GMT
    Content-Type: application/json;charset=utf-8
    Transfer-Encoding: chunked
    Connection: keep-alive
    Access-Control-Allow-Origin: *
    x-ncp-trace-id: 68d1o68pm4cr63gc3169gm4p34
    
    {
        "companyId": "c1798784-9a47-4751-ab9f-b9629825ab93",
        "dfmId": "7ba9b979-024f-4b09-8551-4e638dde0bae",
        "docId": "22541"
    }
    



    Supported Language Codes

    Locale codeDescription
    ko_KRKorean
    ja_JPJapanese
    zh_CNChinese (Simplified)
    zh_TWChinese (Traditional)
    en_USEnglish



    Supported Currency Codes

    Currency codeDescription
    KRWSouth Korean won
    USDU.S. dollar
    CNYChinese yuan
    JPYJapanese yen
    TWDTaiwan dollar
    EUREuropean Union euro
    GBPBritish pound
    AUDAustralian Dollar
    CADCanadian dollar
    NZDNew Zealand dollar
    NOKNorwegian krone
    DKKDanish krone
    RUBRussian ruble
    MYRMalaysian ringgit
    MXNMexico
    MNTMongolia
    VNDVietnamese dong
    BRLBrazil
    SARSaudi Arabia
    SEKSweden
    CHFSwitzerland
    INRIndia
    IDRIndonesia
    THBThai baht
    PHPPhilippine peso
    HKDHong Kong
    ILSIsrael
    AEDUAE dirham
    BDTBangladesh
    BHDBahrain
    BNDBrunei
    CZKCzech Republic
    EGPEgypt
    HUFHungary
    JODJordan
    KWDKuwait
    KZTKazakhstan
    PKRPakistan
    PLNPoland
    SGDSingapore
    TRYTurkey
    ZARSouth African rand

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.