new_releases 업데이트:
출시 노트에서 새로운 기능 및 제품 업데이트를 확인하세요.
Method: files.create
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
미디어 또는 리치 카드 메시지에 사용할 파일을 업로드합니다.
상담사는 파일의 URL 또는 바이너리와 해당 썸네일 파일의 URL (선택사항)을 제공합니다.
중요: 사용자 개인 정보 보호 및 보안을 위해 RBM 플랫폼은 제공된 URL에서 미디어 및 PDF 파일을 다운로드하고 처리한 후 사용자에게 전송합니다. 이렇게 하면 고유한 URL로 상담사를 추적할 수 없습니다. 따라서 고유한 URL을 대량으로 제출하지 마세요. URL이 동일한 파일을 가리키든 다른 파일을 가리키든 RBM 플랫폼에서는 이를 지원하지 않습니다. 동일한 파일에는 동일한 URL을 사용합니다.
RBM 플랫폼은 파일을 60일 동안 캐시하고 상담사 메시지를 보낼 때 파일을 식별하는 데 사용할 수 있는 고유한 이름을 반환합니다.
파일 바이너리를 업로드하려면 업로드 URI에 HTTP POST 요청을 하고 JSON 요청 본문에서 fileUrl
필드를 생략한 후 바이너리를 POST 요청 본문으로 지정합니다. 예를 들어 바이너리 파일의 정규화된 파일 경로와 함께 --upload-file
cURL 플래그를 사용합니다.
HTTP 요청
- 업로드 URI, 미디어 업로드 요청:
POST https://rcsbusinessmessaging.googleapis.com/upload/v1/files
- 메타데이터 URI, 메타데이터 전용 요청:
POST https://rcsbusinessmessaging.googleapis.com/v1/files
URL은 gRPC 트랜스코딩 문법을 사용합니다.
요청 본문
요청 본문에는 다음과 같은 구조의 데이터가 포함됩니다.
JSON 표현 |
{
"fileUrl": string,
"thumbnailUrl": string,
"agentId": string
} |
필드 |
fileUrl |
string
선택사항입니다. 공개적으로 사용 가능한 파일 URL입니다. RBM 플랫폼은 파일을 가져올 때 HTTP 헤더의 content-type 필드에서 파일의 MIME 유형을 결정합니다. RBM은 이미지, 오디오, 동영상, PDF를 지원합니다. 지원되는 이미지 콘텐츠 유형: image/jpeg, image/jpg, image/gif, image/png 지원되는 오디오 콘텐츠 유형: audio/aac, audio/mp3, audio/mpeg, audio/mpg, audio/mp4, audio/mp4-latm, audio/3gpp, application/ogg, audio/ogg 지원되는 동영상 콘텐츠 유형: video/h263, video/m4v, video/mp4, video/mpeg, video/mpeg4, video/webm 지원되는 PDF 콘텐츠 유형: application/pdf 참고: 파일 URL에는 리디렉션이 1개 있을 수 있습니다. 리디렉션된 파일 URL은 공개적으로 액세스할 수 있어야 합니다. CreateAgentMessageRequest의 파일 URL에는 리디렉션이 지원되지 않습니다.
|
thumbnailUrl |
string
선택사항입니다. 파일에 해당하는 썸네일의 공개적으로 사용 가능한 URL입니다. 이 필드를 설정하지 않으면 RBM 플랫폼에서 파일에서 자동으로 썸네일을 생성합니다. RBM 플랫폼은 파일을 가져올 때 HTTP 헤더의 content-type 필드에서 파일의 MIME 유형을 결정합니다. 지원되는 이미지 콘텐츠 유형: image/jpeg, image/jpg, image/gif, image/png
|
agentId |
string
필수 항목입니다. 에이전트의 고유 식별자입니다.
|
응답 본문
에이전트가 메시지를 보낼 때 파일을 식별하는 데 사용할 수 있는 고유한 이름이 있는 파일 리소스입니다.
성공한 경우 응답 본문은 다음과 같은 구조의 데이터를 포함합니다.
JSON 표현 |
{
"name": string
} |
필드 |
name |
string
서버에서 할당한 파일 리소스의 고유한 이름으로, 에이전트가 메시지를 보낼 때 파일을 식별하는 데 사용할 수 있습니다. 형식은 'files/{uid}'이며 여기서 {uid}는 고유 ID입니다.
|
승인 범위
다음 OAuth 범위가 필요합니다.
https://www.googleapis.com/auth/rcsbusinessmessaging
자세한 내용은 OAuth 2.0 Overview를 참조하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eThis process allows agents to upload files, including images, audio, video, and PDFs, for use in media or rich card messages, either by providing a public URL or the file's binary data.\u003c/p\u003e\n"],["\u003cp\u003eThe RBM platform handles file privacy and security by downloading and processing media files from provided URLs, preventing agent tracking via unique URLs, and caches the file for 60 days.\u003c/p\u003e\n"],["\u003cp\u003eThe file upload requires an HTTP POST request to either the upload URI \u003ccode\u003ehttps://rcsbusinessmessaging.googleapis.com/upload/v1/files\u003c/code\u003e or the metadata-only URI \u003ccode\u003ehttps://rcsbusinessmessaging.googleapis.com/v1/files\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe agent can provide a public \u003ccode\u003efileUrl\u003c/code\u003e, \u003ccode\u003ethumbnailUrl\u003c/code\u003e, and must include the \u003ccode\u003eagentId\u003c/code\u003e within the request body to upload files.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful upload, the RBM platform returns a unique file name (\u003ccode\u003ename\u003c/code\u003e) that agents can use to reference the file in subsequent messages.\u003c/p\u003e\n"]]],[],null,["# Method: files.create\n\nUploads a file for use in media or rich card messages.\n\nThe agent provides the URL or binary of the file and (optionally) the URL of the corresponding thumbnail file.\n\nImportant: For user privacy and security, the RBM platform downloads and processes media and PDF files from the provided URLs before delivering them to the user. This prevents agent tracking by unique URLs. Therefore, do not submit a high volume of unique URLs. The RBM platform does not support this, whether the URLs point to the same or different files. Use the same URL for identical files.\n\nThe RBM platform caches the file for 60 days and returns a unique name that you can use to identify the file when sending agent messages.\n\nTo upload a file binary, make an HTTP POST request to the Upload URI, omit the `fileUrl` field from the JSON request body, and specify the binary as the POST request body. For example, use the `--upload-file` cURL flag with the fully qualified file path of the binary file.\n\n### HTTP request\n\n- Upload URI, for media upload requests: \n `POST https://rcsbusinessmessaging.googleapis.com/upload/v1/files`\n- Metadata URI, for metadata-only requests: \n `POST https://rcsbusinessmessaging.googleapis.com/v1/files`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------|\n| ``` { \"fileUrl\": string, \"thumbnailUrl\": string, \"agentId\": string } ``` |\n\n| Fields ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `fileUrl` | `string` Optional. Publicly available URL of the file. The RBM platform determines the MIME type of the file from the content-type field in the HTTP headers when fetching the file. RBM supports image, audio, video, and pdf. Supported image content types: image/jpeg, image/jpg, image/gif, image/png. Supported audio content types: audio/aac, audio/mp3, audio/mpeg, audio/mpg, audio/mp4, audio/mp4-latm, audio/3gpp, application/ogg, audio/ogg. Supported video content types: video/h263, video/m4v, video/mp4, video/mpeg, video/mpeg4, video/webm. Supported pdf content types: application/pdf. Note: file URL can have 1 redirect. Redirected file URLs must be publicly accessible. Redirects are not supported for file URLs in CreateAgentMessageRequest. |\n| `thumbnailUrl` | `string` Optional. Publicly available URL of the thumbnail corresponding to the file. If this field is not set, then the RBM platform automatically generates a thumbnail from the file. The RBM platform determines the MIME type of the file from the content-type field in the HTTP headers when fetching the file. Supported image content types: image/jpeg, image/jpg, image/gif, image/png. |\n| `agentId` | `string` Required. The agent's unique identifier. |\n\n### Response body\n\nA file resource with a unique name that an agent can use to identify the file when sending messages.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------|\n| ``` { \"name\": string } ``` |\n\n| Fields ||\n|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Server-assigned unique name of the file resource, which an agent can use to identify the file when sending messages. The format is \"files/{uid}\", where {uid} is a unique ID. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/rcsbusinessmessaging`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]