기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Cloud Code

Cloud Code

LiveOps
​
​
Cloud Code
  • Overview
  • Get started
  • Server authority
  • Cloud Code C# modules
    • Overview
    • Get started
    • Concepts
    • Tutorials
      • Run modules
        • Unity Runtime
        • REST API
      • Write modules
      • Development essentials
      • Automate deployment
      • Integrate services
      • Advanced configuration
      • Use Cases
    • Reference
  • Cloud Code JavaScript scripts
  • Logging
  • Use-case samples
  • Privacy and consent
  1. Cloud Code
  2. 모듈 실행

Cloud Code API 호출

Invoke module endpoints using HTTP requests to the Cloud Code REST API.
읽는 시간 2분
최근 업데이트: 9달 전

모듈 엔드포인트를 실행하려면 Cloud Code API를 호출합니다. 자세한 내용은 Cloud Code API 기술 자료를 참고하십시오.
참고
참고: 지난 15분 내에 모듈에 어떤 트래픽도 수신되지 않으면 콜드 스타트 지연을 경험하게 될 수 있습니다. 모듈에 대한 후속 호출이 발생하면 이는 더 빠르게 처리됩니다.

Authentication

서비스 계정이나 상태 비보존 토큰을 사용하여 플레이어 또는 신뢰할 수 있는 클라이언트로 인증하려면 인증을 참고하십시오. 받은 토큰을 요청 헤더에서 HTTP 인증을 위한 bearer 토큰으로 사용합니다.
Authorization: Bearer <BEARER_TOKEN>

모듈 엔드포인트 요청 실행

POST 요청을 다음으로 보내 Cloud Code API를 호출합니다.
https://cloud-code.services.api.unity.com/v1/projects/<PROJECT_ID>/modules/<MODULE_NAME>/<FUNCTION_NAME>
다음과 같이 경로 파라미터를 정의합니다.
  • PROJECT_ID
    - 프로젝트 ID입니다.
  • MODULE_NAME
    - 모듈 이름입니다.
  • FUNCTION_NAME
    - 모듈 엔드포인트 이름으로, 코드에서 정의한
    CloudCodeFunction
    입니다.
간단한 cURL 커맨드는 다음과 같습니다.
curl --request POST 'https://cloud-code.services.api.unity.com/v1/projects/<PROJECT_ID>/modules/<MODULE_NAME>/<FUNCTION_NAME>' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer <BEARER_TOKEN>'

요청 페이로드

메서드 서명 내의 모듈 함수에서 파라미터를 정의할 수 있습니다. 모듈 함수의 구조를 만드는 방법은 모듈 구조를 참고하십시오. 예를 들어 다음 메서드는 문자열 파라미터 weapon과 bodyPart를 정의합니다.
[CloudCodeFunction("IntroduceGuard")]public string IntroduceGuard(string weapon, string bodyPart){return $"I used to be an adventurer like you. Then I took an ${weapon} to the ${bodyPart}.";}
이 파라미터는 엔드포인트를 호출할 때 요청 본문에서 JSON으로 전달됩니다. 파라미터의 대소문자는 메서드 서명과 일치해야 합니다.
{ "params": { "weapon": "arrow", "bodyPart": "knee" }}
완전한 cURL 커맨드는 다음과 같습니다.
curl --request POST 'https://cloud-code.services.api.unity.com/v1/projects/<PROJECT_ID>/modules/<MODULE_NAME>/<FUNCTION_NAME>' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer <BEARER_TOKEN>' \--data-raw '{ "params": { "weapon": "arrow", "bodyPart": "knee" }}'

샘플 출력

다음은 모듈 출력 예시입니다.
{ "output": "I used to be an adventurer like you. Then I took an arrow to the knee."}

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.

  • 보고 있는 페이지
    • Authentication

    • 모듈 엔드포인트 요청 실행

    • 요청 페이로드

    • 샘플 출력


이 페이지의 문제 보고