new_releases আপডেট : নতুন বৈশিষ্ট্য এবং পণ্য আপডেটের জন্য
রিলিজ নোট চেক করুন।
Method: files.create
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
মিডিয়া বা রিচ কার্ড বার্তাগুলিতে ব্যবহারের জন্য একটি ফাইল আপলোড করে৷
এজেন্ট ফাইলের URL বা বাইনারি এবং (ঐচ্ছিকভাবে) সংশ্লিষ্ট থাম্বনেল ফাইলের URL প্রদান করে।
গুরুত্বপূর্ণ: ব্যবহারকারীর গোপনীয়তা এবং নিরাপত্তার জন্য, RBM প্ল্যাটফর্ম প্রদত্ত ইউআরএল থেকে মিডিয়া এবং পিডিএফ ফাইল ব্যবহারকারীর কাছে পৌঁছে দেওয়ার আগে ডাউনলোড করে এবং প্রক্রিয়া করে। এটি অনন্য URL দ্বারা এজেন্ট ট্র্যাকিং প্রতিরোধ করে। তাই, বেশি পরিমাণে ইউনিক ইউআরএল জমা দেবেন না। RBM প্ল্যাটফর্ম এটিকে সমর্থন করে না, URLগুলি একই বা ভিন্ন ফাইলের দিকে নির্দেশ করে। অভিন্ন ফাইলের জন্য একই 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 শিরোনামের বিষয়বস্তু-টাইপ ক্ষেত্র থেকে ফাইলের MIME প্রকার নির্ধারণ করে। RBM ইমেজ, অডিও, ভিডিও এবং পিডিএফ সমর্থন করে। সমর্থিত ছবির বিষয়বস্তুর প্রকার: image/jpeg, image/jpg, image/gif, image/png। সমর্থিত অডিও বিষয়বস্তুর প্রকার: অডিও/aac, অডিও/mp3, অডিও/mpeg, অডিও/mpg, audio/mp4, audio/mp4-latm, audio/3gpp, application/ogg, audio/ogg। সমর্থিত ভিডিও সামগ্রী প্রকার: video/h263, video/m4v, video/mp4, video/mpeg, video/mpeg4, video/webm। সমর্থিত পিডিএফ সামগ্রী প্রকার: অ্যাপ্লিকেশন/পিডিএফ। দ্রষ্টব্য: ফাইল ইউআরএলে 1টি পুনঃনির্দেশ থাকতে পারে। পুনঃনির্দেশিত ফাইল URL গুলি অবশ্যই সর্বজনীনভাবে অ্যাক্সেসযোগ্য হতে হবে৷ CreateAgentMessageRequest-এ ফাইল URL-এর জন্য রিডাইরেক্ট সমর্থিত নয়। |
thumbnailUrl | string ঐচ্ছিক। ফাইলের সাথে সম্পর্কিত থাম্বনেইলের সর্বজনীনভাবে উপলব্ধ URL। যদি এই ক্ষেত্রটি সেট করা না থাকে, তাহলে RBM প্ল্যাটফর্ম স্বয়ংক্রিয়ভাবে ফাইল থেকে একটি থাম্বনেইল তৈরি করে। RBM প্ল্যাটফর্ম ফাইলটি আনার সময় HTTP শিরোনামের বিষয়বস্তু-টাইপ ক্ষেত্র থেকে ফাইলের MIME প্রকার নির্ধারণ করে। সমর্থিত ছবির বিষয়বস্তুর প্রকার: image/jpeg, image/jpg, image/gif, image/png। |
agentId | string প্রয়োজন। এজেন্টের অনন্য শনাক্তকারী। |
প্রতিক্রিয়া শরীর
একটি অনন্য নামের একটি ফাইল সংস্থান যা একটি এজেন্ট বার্তা পাঠানোর সময় ফাইল সনাক্ত করতে ব্যবহার করতে পারে।
সফল হলে, প্রতিক্রিয়া বডিতে নিম্নলিখিত কাঠামোর সাথে ডেটা থাকে:
JSON প্রতিনিধিত্ব |
---|
{
"name": string
} |
ক্ষেত্র |
---|
name | string সার্ভার দ্বারা নির্ধারিত ফাইল রিসোর্সের অনন্য নাম, যা একটি এজেন্ট বার্তা পাঠানোর সময় ফাইল সনাক্ত করতে ব্যবহার করতে পারে। ফরম্যাট হল "files/{uid}", যেখানে {uid} একটি অনন্য আইডি। |
অনুমোদনের সুযোগ
নিম্নলিখিত OAuth সুযোগ প্রয়োজন:
-
https://www.googleapis.com/auth/rcsbusinessmessaging
আরো তথ্যের জন্য, দেখুনOAuth 2.0 Overview .
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 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)."]]