기술 자료

지원

Cloud Code

Cloud Code

외부 서비스와 연동

Call public internet endpoints and public APIs from your Cloud Code scripts.
읽는 시간 1분최근 업데이트: 한 달 전

Cloud Code를 사용하면 UGS에 속한 공개 API를 비롯한 모든 공개 인터넷 엔드포인트를 호출할 수 있습니다. 다음 예시는 Cat Facts API를 호출하여 고양이에 관한 무작위 정보를 가져오는 방법을 보여 줍니다.
JavaScript
const axios = require("axios-0.21");module.exports = async ({ params, context, logger }) => { let result; try { const catFactUrl = `https://catfact.ninja/fact`; result = await axios.get(catFactUrl); return result.data; } catch (err) { logger.error("Failed to call out to Cat Facts", {"error.message": err.message}); throw err; }};
자세한 내용을 알아보려면 다른 Unity 서비스와 연동하는 방법을 참고하십시오.