용어집 목록 조회
    • PDF

    용어집 목록 조회

    • PDF

    기사 요약

    개요

    용어집 목록을 조회하는 API입니다.

    용어집 목록 조회

    API URL

    GET https://papago.apigw.gov-ntruss.com/glossary/v1/?currentPage={page}&pageSize={size}
    

    요청 헤더

    API 호출 시 요청 헤더 정보가 필요합니다.
    요청 헤더에 대한 자세한 가이드는 용어집 개요를 참조해 주십시오.

    x-ncp-apigw-timestamp:{Timestamp}
    x-ncp-iam-access-key:{Account Access Key}
    x-ncp-apigw-signature-v2:{API Gateway Signature}
    

    요청 파라미터

    필드명유형필수 여부타입설명
    currentPagequery stringYesString용어집 목록을 여러 번 나누어 조회하는 경우 페이지 단위로 호출 가능
    pageSizequery stringYesString조회할 용어집 개수
  • 기본값: 20, 최댓값: 30
  • 예시: /glossary/v1/?currentPage=1&pageSize=10
  • 요청 예시

    import hashlib
    import hmac
    import base64
    import time
    import requests
    
    
    def make_signature(access_key, secret_key, timestamp, url, method):
        timestamp = str(timestamp)
        secret_key = bytes(secret_key, 'UTF-8')
    
        message = method + " " + url + "\n" + timestamp + "\n" + access_key
        message = bytes(message, 'UTF-8')
        signingKey = base64.b64encode(hmac.new(secret_key, message, digestmod=hashlib.sha256).digest())
        return signingKey.decode('UTF-8')
    
    
    def get_user_glossary():
        baseurl = "https://papago.apigw.gov-ntruss.com" #{OpenAPI endpoint}
        url = "/glossary/v1/?currentPage={}&pageSize={}"
    
        access_key = "DonNfVLUKOMNnmXXXXXX" #{Main / Sub Account Access Key}
        secret_key = "W5RyNUbIzOuUsEM8v8eqreMdSQZHMm9nfgXXXXXX" #{Main / Sub Account Secret Key}
        timestamp = int(time.time() * 1000)
        method = "GET"
        url = url.format(1, 10)  # {change {} in url to page number and page size.}
    
        signature = make_signature(access_key, secret_key, timestamp, url, method)
    
        url = baseurl + url
        headers = {
            "x-ncp-apigw-timestamp": str(timestamp),
            "x-ncp-iam-access-key": access_key,
            "x-ncp-apigw-signature-v2": str(signature)
        }
    
        response = requests.get(url=url, verify=True, headers=headers)
    

    응답 예시

    json
        "data": [
            {
                "glossaryKey": "c26b6e45-437c-43ea-ae7f-22adb03f7eb0",
                "glossaryName": "Glossary1",
                "wordCount": 2,
                "description": "Glossary1 용어집 설명 입니다.",
                "createdDateTime": 1700024446000,
                "updatedDateTime": 1700025426000
            }
        ],
        currentPage": 1, "totalPage": 5, "currentGlossaryCount": 20, "totalGlossaryCount": 30
        }
    

    이 문서가 도움이 되었습니까?

    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.