8 सितंबर, 2025 से, हर नए लाइन आइटम को यह बताना होगा कि वह यूरोपियन यूनियन (ईयू) में राजनैतिक विज्ञापन दिखाएगा या नहीं. Display & Video 360 API और एसडीएफ़ अपलोड करने की उन कार्रवाइयों को पूरा नहीं किया जा सकेगा जिनमें एलान नहीं किया गया है. इस बारे में ज़्यादा जानने के लिए कि इंटिग्रेशन को अपडेट करके यह एलान कैसे किया जाए, हमारा हटाए गए टैग और एट्रिब्यूट का पेज देखें.
टाइम आउट और बार-बार की जाने वाली कोशिशें कॉन्फ़िगर करें
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Display & Video 360 के कई एपीआई तरीके, ऐसे जटिल काम करते हैं जिन्हें पूरा होने में कुछ सेकंड से ज़्यादा समय लग सकता है. इन तरीकों से किए गए अनुरोधों में, कभी-कभी अनुमानित इंतज़ार का समय ज़्यादा हो सकता है. इसकी वजह से, एपीआई या क्लाइंट साइड पर गड़बड़ियां हो सकती हैं. इस पेज पर, अनुरोध के इंतज़ार में लगने वाले लंबे समय की वजह से होने वाली समस्याओं को हल करने के तरीकों के बारे में बताया गया है.
क्लाइंट लाइब्रेरी में डिफ़ॉल्ट टाइम आउट बढ़ाना
रेफ़रंस दस्तावेज़ में, कुछ खास तरीकों को लेबल किया गया है. इनमें, अनुमानित इंतज़ार का समय नियमित तौर पर ज़्यादा होने की जानकारी दी गई है. अन्य तरीकों से भी समय-समय पर, ज़्यादा इंतज़ार का व्यवहार दिख सकता है.
कुछ क्लाइंट लाइब्रेरी के लिए, डिफ़ॉल्ट टाइम आउट की सीमाएं तय होती हैं. इन सीमाओं के अंदर अनुरोध पूरा न होने पर गड़बड़ियां हो सकती हैं. काम करने वाली क्लाइंट लाइब्रेरी के सबसेट के लिए, डिफ़ॉल्ट टाइम आउट ये हैं:
Java: 20 सेकंड
Python: 60 सेकंड
PHP: 60 सेकंड
इन डिफ़ॉल्ट टाइम आउट को बढ़ाकर, क्लाइंट-साइड टाइम आउट से बचा जा सकता है. रनटाइम के दौरान, अपनी क्लाइंट लाइब्रेरी के लिए डिफ़ॉल्ट टाइम आउट में बदलाव करने के लिए, इन निर्देशों का पालन करें:
/** * Adjusts HTTP timeout values used by the provided request initializer. * * @param requestInitializer The {@link HttpRequestInitializer} used to authorize requests. * @param newHttpTimeout The HTTP timeout for requests in seconds. * @return An {@link HttpRequestInitializer} with modified HTTP timeout values. */privatestaticHttpRequestInitializersetHttpTimeout(finalHttpRequestInitializerrequestInitializer,finalintnewHttpTimeout){returnnewHttpRequestInitializer(){@Overridepublicvoidinitialize(HttpRequesthttpRequest)throwsIOException{requestInitializer.initialize(httpRequest);httpRequest.setConnectTimeout(newHttpTimeout*1_000);httpRequest.setReadTimeout(newHttpTimeout*1_000);}};}
Display & Video 360 API क्लाइंट बनाते समय कॉल फ़ंक्शन.
// Create authorized API client with non-default timeouts.DisplayVideoservice=newDisplayVideo.Builder(credential.getTransport(),credential.getJsonFactory(),setHttpTimeout(credential,http-timeout-in-seconds)).setApplicationName("displayvideo-java-installed-app-sample").build();
Python
Google API Python क्लाइंट लाइब्रेरी का http मॉड्यूल इंपोर्ट करें.
$httpClient = new \GuzzleHttp\Client(['timeout' => http-timeout-in-seconds]);
Google क्लाइंट बनाएं और Guzzle एचटीटीपी क्लाइंट असाइन करें.
$client = new Google_Client();$client->setHttpClient($httpClient);
एपीआई टाइम आउट की गड़बड़ियां ठीक करना
कुछ मामलों में, जटिल ऑपरेशन को पूरा करने वाले अनुरोध, सर्वर-साइड के 180 सेकंड के टाइम आउट से ज़्यादा समय ले सकते हैं. इस वजह से, एपीआई 408 या 504 गड़बड़ी का रिस्पॉन्स दिखा सकता है.
अगर किसी अनुरोध का जवाब इनमें से किसी भी गड़बड़ी कोड के साथ मिलता है, तो हमारा सुझाव है कि आप एक्सपोनेंशियल बैकऑफ़ रणनीति का इस्तेमाल करके, इन अनुरोधों को फिर से आज़माएं.
अगर गड़बड़ी बनी रहती है, तो संपर्क फ़ॉर्म का इस्तेमाल करके सहायता टीम से संपर्क करें.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eSome Display & Video 360 API methods might take longer to complete, potentially leading to errors due to request latency.\u003c/p\u003e\n"],["\u003cp\u003eYou can increase the default timeout in your client library (Java, Python, or PHP) to avoid client-side timeout errors.\u003c/p\u003e\n"],["\u003cp\u003eThe Display & Video 360 API has a server-side timeout of 180 seconds, after which it will return a \u003ccode\u003e408\u003c/code\u003e or \u003ccode\u003e504\u003c/code\u003e error.\u003c/p\u003e\n"],["\u003cp\u003eIf a request exceeds the server-side timeout, retry it using exponential backoff and contact support if the issue persists.\u003c/p\u003e\n"]]],["The core issue addressed is managing request latency with the Display & Video 360 API, where some operations may take longer than expected. To prevent client-side timeout errors, it is recommended to increase the default timeout in the client library. The provided examples show how to adjust timeout settings in Java, Python, and PHP. In the rare case that requests exceed the API's 180-second server-side timeout, resulting in `408` or `504` errors, the advice is to retry with exponential backoff and contact support if problems continue.\n"],null,["# Configure timeouts and retries\n\nMany Display \\& Video 360 API methods perform complex operations that might take longer than\na few seconds to complete. Requests to these methods can sometimes exceed\nexpected latency, causing errors on the API or client side. This page lists\npractices for handling issues caused by extended request latency.\n\nIncrease default timeout in client library\n------------------------------------------\n\nA handful of specific methods have been labeled in their reference documentation\nas regularly exceeding expected latency. Other methods could also exhibit\nhigh-latency behavior periodically.\n\nThe default timeout limits for some client libraries could result in errors when\nmaking high-latency requests. Default timeouts for a subset of supported client\nlibraries are:\n\n- **Java**: 20 seconds\n- **Python**: 60 seconds\n- **PHP**: 60 seconds\n\nClient-side timeouts can be avoided by raising these default timeouts. Follow\nthese instructions to adjust the default timeout for your client library during\nruntime:\n**Caution:** The Display \\& Video 360 API has a server-side timeout value of 180 seconds. If a request lasts longer than 180 seconds, the API will return an error. \n\n### Java\n\n1. **Import necessary resources.**\n\n import com.google.api.client.http.HttpRequest;\n import com.google.api.client.http.HttpRequestInitializer;\n import java.io.IOException;\n\n2. **Build function for setting HTTP timeout.**\n\n /**\n * Adjusts HTTP timeout values used by the provided request initializer.\n *\n * @param requestInitializer The {@link HttpRequestInitializer} used to authorize requests.\n * @param newHttpTimeout The HTTP timeout for requests in seconds.\n * @return An {@link HttpRequestInitializer} with modified HTTP timeout values.\n */\n private static HttpRequestInitializer setHttpTimeout(\n final HttpRequestInitializer requestInitializer,\n final int newHttpTimeout) {\n return new HttpRequestInitializer() {\n @Override\n public void initialize(HttpRequest httpRequest) throws IOException {\n requestInitializer.initialize(httpRequest);\n httpRequest.setConnectTimeout(newHttpTimeout * 1_000);\n httpRequest.setReadTimeout(newHttpTimeout * 1_000);\n }\n };\n }\n\n3. **Call function when creating the Display \\& Video 360 API client.**\n\n // Create authorized API client with non-default timeouts.\n DisplayVideo service =\n new DisplayVideo.Builder(\n credential.getTransport(),\n credential.getJsonFactory(),\n setHttpTimeout(credential, \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ehttp\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e-\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003etimeout\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e-\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003ein\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e-\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003eseconds\u003c/span\u003e\u003c/var\u003e)\n )\n .setApplicationName(\"displayvideo-java-installed-app-sample\")\n .build();\n\n### Python\n\n1. **Import Google API Python client library http module.**\n\n from googleapiclient import http\n\n2. **Update default timeout constant.**\n\n http.DEFAULT_HTTP_TIMEOUT_SEC = \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ehttp\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e-\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003etimeout\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e-\u003c/span\u003e\u003cspan class=\"devsite-syntax-ow\"\u003ein\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e-\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003eseconds\u003c/span\u003e\u003c/var\u003e\n\n3. **Build API service.**\n\n # Build the API service.\n service = discovery.build(\n 'displayvideo',\n 'v3',\n discoveryServiceUrl=discovery_url,\n credentials=credentials)\n\n### PHP\n\n1. **Download and install the Guzzle HTTP library using\n [Composer](//getcomposer.org/).**\n\n composer require guzzlehttp/guzzle:^7.0\n\n2. **Create Guzzle HTTP client, assigning timeout value.**\n\n $httpClient = new \\GuzzleHttp\\Client(['timeout' =\u003e \u003cvar translate=\"no\"\u003ehttp-timeout-in-seconds\u003c/var\u003e]);\n\n3. **Create Google client and assign Guzzle HTTP client.**\n\n $client = new Google_Client();\n $client-\u003esetHttpClient($httpClient);\n\nHandle API timeout errors\n-------------------------\n\nIn rare cases, requests completing complex operations could exceed the\nserver-side timeout of 180 seconds, causing the API to return a `408` or `504`\nerror response.\n\nIf a request responds with either of these error codes, we recommend that you\nretry these requests using the [exponential backoff strategy](/display-video/api/guides/how-tos/upload#exp-backoff).\n\nIf the error persists, reach out to support using the [contact form](/display-video/api/support/contact)."]]