সেশন টোকেনগুলি একটি ব্যবহারকারীর স্বয়ংসম্পূর্ণ অনুসন্ধানের প্রশ্ন এবং নির্বাচনের পর্যায়গুলিকে বিলিং উদ্দেশ্যে একটি পৃথক সেশনে গোষ্ঠীভুক্ত করে।
একটি সেশন টোকেন তৈরি করুন
ব্যবহারকারীরা প্রতিটি সেশনের জন্য অনন্য সেশন টোকেন তৈরি করার জন্য দায়ী। Google সংস্করণ 4 UUID ব্যবহার করার পরামর্শ দেয়৷
উদাহরণ
ব্যবহারকারী একটি ক্যোয়ারী টাইপ করলে, একটি স্বয়ংসম্পূর্ণ অনুরোধ প্রতি কয়েকটি কীস্ট্রোকে বলা হয় (অক্ষর প্রতি নয়), এবং সম্ভাব্য ফলাফলের একটি তালিকা ফেরত দেওয়া হয়। ব্যবহারকারী যখন ফলাফলের তালিকা থেকে একটি নির্বাচন করে, তখন নির্বাচনটি একটি অনুরোধ হিসাবে গণনা করা হয় এবং অনুসন্ধানের সময় করা সমস্ত অনুরোধগুলি একত্রিত এবং একটি একক অনুরোধ হিসাবে গণনা করা হয়। যদি ব্যবহারকারী একটি স্থান নির্বাচন করে, অনুসন্ধান ক্যোয়ারী কোন চার্জ ছাড়াই উপলব্ধ, এবং শুধুমাত্র স্থান ডেটা অনুরোধ চার্জ করা হয়. ব্যবহারকারী সেশন শুরুর কয়েক মিনিটের মধ্যে নির্বাচন না করলে, শুধুমাত্র অনুসন্ধান ক্যোয়ারী চার্জ করা হয়।
একটি অ্যাপের দৃষ্টিকোণ থেকে ইভেন্টের এই প্রবাহটি পরীক্ষা করা যাক।
একজন ব্যবহারকারী "প্যারিস, ফ্রান্স" অনুসন্ধান করতে একটি ক্যোয়ারী টাইপ করা শুরু করে৷
ব্যবহারকারীর ইনপুট সনাক্ত করার পরে, অ্যাপটি একটি নতুন সেশন টোকেন তৈরি করে, "টোকেন এ"।
ব্যবহারকারীর টাইপ হিসাবে, API প্রতি কয়েকটি অক্ষরের একটি স্বয়ংসম্পূর্ণ অনুরোধ করে, প্রতিটির সম্ভাব্য ফলাফলের একটি নতুন তালিকা প্রদর্শন করে: "পি" "পার" "প্যারিস," "প্যারিস, ফরাসী"
যখন ব্যবহারকারী একটি নির্বাচন করে:
ক্যোয়ারী থেকে প্রাপ্ত সমস্ত অনুরোধ একক অনুরোধ হিসাবে "টোকেন A" দ্বারা উপস্থাপিত সেশনে গোষ্ঠীভুক্ত এবং যোগ করা হয়।
ব্যবহারকারীর নির্বাচন একটি স্থান বিস্তারিত অনুরোধ হিসাবে গণনা করা হয়, এবং "টোকেন A" দ্বারা উপস্থাপিত সেশনে যোগ করা হয়।
অধিবেশন সমাপ্ত হয়, এবং অ্যাপ "টোকেন A" বাতিল করে দেয়।
স্বয়ংসম্পূর্ণ অনুরোধগুলি কীভাবে বিল করা হয় সে সম্পর্কে আরও তথ্যের জন্য, ব্যবহার এবং বিলিং দেখুন।
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eSession tokens are used to group autocomplete search queries and selections for billing purposes.\u003c/p\u003e\n"],["\u003cp\u003eEach session requires a unique token, ideally a version 4 UUID.\u003c/p\u003e\n"],["\u003cp\u003eAutocomplete requests are bundled and billed as a single request when a user makes a selection.\u003c/p\u003e\n"],["\u003cp\u003eIf no selection is made, only the search query is charged after a few minutes.\u003c/p\u003e\n"],["\u003cp\u003eSession tokens can be shared across different Google Cloud projects, but must be unique within a single project.\u003c/p\u003e\n"]]],["This document details the use of session tokens with the Places API. A session token groups a user's autocomplete search into a single session for billing. Users must create unique session tokens (version 4 UUIDs recommended) for each session, ensuring uniqueness within a project. Requests are bundled into a session. If a user selects a place, only the place details are charged; otherwise, only the search query is charged. Each session ends after a user's selection or inactivity, at which point the token is discarded.\n"],null,["# Use session tokens\n\n\u003cbr /\u003e\n\n| This feature requires that you enable Places API (New), the next generation of the Places API. For more information, see [Enable APIs](/maps/documentation/places/ios-sdk/cloud-setup#enabling-apis).\n\n\u003cbr /\u003e\n\n\nSelect platform: [Android](/maps/documentation/places/android-sdk/using-session-tokens \"View this page for the Android platform docs.\") [iOS](/maps/documentation/places/ios-sdk/using-session-tokens \"View this page for the iOS platform docs.\") [Web Service](/maps/documentation/places/web-service/using-session-tokens \"View this page for the Web Service platform docs.\")\n\n\u003cbr /\u003e\n\nSession tokens group the query and selection phases of a user autocomplete\nsearch into a discrete session for billing purposes.\n\nCreate a session token\n----------------------\n\nUsers are responsible for generating unique session\ntokens for each session. Google recommends using [version 4\nUUIDs](https://tools.ietf.org/html/rfc4122).\n| **Note:** Session tokens can overlap across Google Cloud Console projects, but they must be unique per project. For example, an app using Project A and an app using Project B can use the same session token, but multiple apps using Project A cannot use the same session token.\n\nExample\n-------\n\nAs the user types a query, an autocomplete request is called every few\nkeystrokes (not per-character), and a list of possible results is returned. When\nthe user makes a selection from the result list, the selection counts as a\nrequest, and all of the requests made during the search are bundled and counted\nas a single request. If the user selects a place, the search query is available\nat no charge, and only the Place data request is charged. If the user does not\nmake a selection within a few minutes of the beginning of the session, only the\nsearch query is charged.\n\nLet's examine this flow of events from the perspective of an app.\n\n1. A user begins typing a query to search for \"Paris, France\".\n2. Upon detecting user input, the app creates a new session token, \"Token A\".\n3. As the user types, the API makes an autocomplete request every few characters, displaying a new list of potential results for each: \n \"P\" \n \"Par\" \n \"Paris,\" \n \"Paris, Fr\"\n4. When the user makes a selection:\n\n- All requests resulting from the query are grouped and added to the session represented by \"Token A\", as a single request.\n- The user's selection is counted as a Place Detail request, and added to the session represented by \"Token A\".\n- The session is concluded, and the app discards \"Token A\".\n\nFor more information about how Autocomplete requests are billed, see [Usage and\nBilling](/maps/documentation/places/ios-sdk/usage-and-billing)."]]