Hi,
for the past several days I have been getting “503 service temporarily unavailable” from several API endpoints. Around 2-3% of the time I can get it to work and get the data I requested. Here I have two full request/response pairs one with a status of 200 OK and one with a status of 503 service temporarily unavailable with about a 30 minute gap between them. The underlying request doesn’t change but the response I get back from your API does.
200 OK:
{
"response": {
"raw": "HTTP\/1.1 200 OK\r\ncontent-disposition: attachment; filename=json.json REMOVED FROM PUBLIC",
"headers": {
"HTTP\/1.1 200 OK": "",
"content-disposition": "attachment; filename=json.json",
"content-encoding": "gzip",
"content-length": "293",
"content-type": "application\/json;charset=utf-8",
"date": "Thu, 23 Aug 2018 14:22:18 GMT",
"server": "tsa_b",
"set-cookie": [
"personalization_id=\"REMOVED==\"; Expires=Sat, 22 Aug 2020 14:22:18 GMT; Path=\/; Domain=.twitter.com",
"guest_id=v1%REMOVED; Expires=Sat, 22 Aug 2020 14:22:18 GMT; Path=\/; Domain=.twitter.com"
],
"strict-transport-security": "max-age=631138519",
"x-access-level": "read-write",
"x-api-version": "3.0",
"x-connection-hash": "7b06c74d910bd05aeb677caed310e659",
"x-content-type-options": "nosniff",
"x-current-api-version": "3.0",
"x-frame-options": "SAMEORIGIN",
"x-rate-limit-limit": "2000",
"x-rate-limit-remaining": "1997",
"x-rate-limit-reset": "1535034981",
"x-response-time": "23",
"x-runtime": "0.007969",
"x-transaction": "0090f68f00bace3e",
"x-xss-protection": "1; mode=block; report=https:\/\/twitter.com\/i\/xss_report",
"": ""
},
"code": 200,
"response": "{\"request\":{\"params\":{}},\"next_cursor\":null,\"data\":[{\"name\":\"Shape\",\"business_name\":null,\"timezone\":\"America\\\/Los_Angeles\",\"timezone_switch_at\":\"2015-06-16T07:00:00Z\",\"id\":\"18ce53zdvzg\",\"created_at\":\"2015-06-17T21:32:28Z\",\"salt\":\"REMOVED\",\"updated_at\":\"2018-07-31T17:09:55Z\",\"industry_type\":null,\"business_id\":null,\"approval_status\":\"ACCEPTED\",\"deleted\":false}]}",
"info": {
"url": "https:\/\/ads-api.twitter.com\/3\/accounts",
"content_type": "application\/json;charset=utf-8",
"http_code": 200,
"header_size": 933,
"request_size": 542,
"filetime": -1,
"ssl_verify_result": 0,
"redirect_count": 0,
"total_time": 0.481143,
"namelookup_time": 0.004624,
"connect_time": 0.082367,
"pretransfer_time": 0.378971,
"size_upload": 0,
"size_download": 293,
"speed_download": 608,
"speed_upload": 0,
"download_content_length": 293,
"upload_content_length": -1,
"starttransfer_time": 0.481106,
"redirect_time": 0,
"redirect_url": "",
"primary_ip": "removed",
"certinfo": [
],
"primary_port": 443,
"local_ip": "removed",
"local_port": 56477,
"request_header": "GET \/3\/accounts HTTP\/1.1\r\nHost: ads-api.twitter.com\r\nUser-Agent: tmhOAuth 0.8.4+SSL - \/\/github.com\/themattharris\/tmhOAuth\r\nAccept: *\/*\r\nAccept-Encoding: deflate, gzip\r\n0: Content-Type: application\/x-www-form-urlencoded\r\nAuthorization: OAuth oauth_consumer_key=\"REMOVED\", oauth_nonce=\"REMOVED\", oauth_signature=\"REMOVED%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1535034137\", oauth_token=\"REMOVED\", oauth_version=\"1.0\"\r\n\r\n"
},
"error": "",
"errno": 0
},
"config": {
"user_agent": "tmhOAuth 0.8.4+SSL - \/\/github.com\/themattharris\/tmhOAuth",
"host": "api.twitter.com",
"method": "GET",
"consumer_key": "removed-from-public",
"consumer_secret": "removed-from-public",
"token": "removed-from-public",
"secret": "removed-from-public",
"bearer": "",
"oauth_version": "1.0",
"oauth_signature_method": "HMAC-SHA1",
"curl_http_version": 2,
"curl_connecttimeout": 30,
"curl_timeout": 10,
"curl_ssl_verifyhost": 2,
"curl_ssl_verifypeer": true,
"use_ssl": true,
"curl_cainfo": "REMOVED",
"curl_capath": "REMOVED",
"curl_sslversion": false,
"curl_followlocation": false,
"curl_proxy": false,
"curl_proxyuserpwd": false,
"curl_encoding": "",
"is_streaming": false,
"streaming_eol": "\r\n",
"streaming_metrics_interval": 10,
"as_header": true,
"force_nonce": false,
"force_timestamp": false
},
"buffer": null,
"request_settings": {
"params": [
],
"headers": {
"0": "Content-Type: application\/x-www-form-urlencoded",
"Authorization": "OAuth oauth_consumer_key=\"REMOVED\", oauth_nonce=\"REMOVE\", oauth_signature=\"REMOVE\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1535034137\", oauth_token=\"REMOVE\", oauth_version=\"1.0\""
},
"with_user": true,
"multipart": false,
"method": "GET",
"without_bearer": true,
"url": "https:\/\/ads-api.twitter.com\/3\/accounts",
"oauth1_params": {
"oauth_consumer_key": "REMOVE",
"oauth_nonce": "REMOVE",
"oauth_signature": "REMOVE",
"oauth_signature_method": "HMAC-SHA1",
"oauth_timestamp": "1535034137",
"oauth_token": "REMOVE",
"oauth_version": "1.0"
},
"prepared_params": [
],
"basestring_params": "REMOVE",
"basestring": "REMOVE",
"signing_key": "REMOVE"
}
}
503 Service Temporarily Unavailable
{
"response": {
"raw": "HTTP\/1.1 503 Service Temporarily Unavailable\r\ncontent-length: 0\r\ndate: Thu, 23 Aug 2018 14:53:59 GMT\r\nserver: tsa_a\r\nx-connection-hash: 79601276f604cde8aea5d8a3e208fe84\r\n\r\n",
"headers": {
"HTTP\/1.1 503 Service Temporarily Unavailable": "",
"content-length": "0",
"date": "Thu, 23 Aug 2018 14:53:59 GMT",
"server": "tsa_a",
"x-connection-hash": "79601276f604cde8aea5d8a3e208fe84",
"": ""
},
"code": 503,
"response": "",
"info": {
"url": "https:\/\/ads-api.twitter.com\/3\/accounts",
"content_type": null,
"http_code": 503,
"header_size": 172,
"request_size": 546,
"filetime": -1,
"ssl_verify_result": 0,
"redirect_count": 0,
"total_time": 0.449178,
"namelookup_time": 0.004779,
"connect_time": 0.092775,
"pretransfer_time": 0.379432,
"size_upload": 0,
"size_download": 0,
"speed_download": 0,
"speed_upload": 0,
"download_content_length": 0,
"upload_content_length": -1,
"starttransfer_time": 0.449109,
"redirect_time": 0,
"redirect_url": "",
"primary_ip": "REMOVE",
"certinfo": [
],
"primary_port": 443,
"local_ip": "REMOVE",
"local_port": 57725,
"request_header": "GET \/3\/accounts HTTP\/1.1\r\nHost: ads-api.twitter.com\r\nUser-Agent: tmhOAuth 0.8.4+SSL - \/\/github.com\/themattharris\/tmhOAuth\r\nAccept: *\/*\r\nAccept-Encoding: deflate, gzip\r\n0: Content-Type: application\/x-www-form-urlencoded\r\nAuthorization: OAuth oauth_consumer_key=\"REMOVE\", oauth_nonce=\"REMOVE\", oauth_signature=\"REMOVE\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1535036039\", oauth_token=\"REMOVE\", oauth_version=\"1.0\"\r\n\r\n"
},
"error": "",
"errno": 0
},
"config": {
"user_agent": "tmhOAuth 0.8.4+SSL - \/\/github.com\/themattharris\/tmhOAuth",
"host": "api.twitter.com",
"method": "GET",
"consumer_key": "REMOVE",
"consumer_secret": "REMOVE",
"token": "REMOVE",
"secret": "REMOVE",
"bearer": "",
"oauth_version": "1.0",
"oauth_signature_method": "HMAC-SHA1",
"curl_http_version": 2,
"curl_connecttimeout": 30,
"curl_timeout": 10,
"curl_ssl_verifyhost": 2,
"curl_ssl_verifypeer": true,
"use_ssl": true,
"curl_cainfo": "REMOVE",
"curl_capath": "REMOVE",
"curl_sslversion": false,
"curl_followlocation": false,
"curl_proxy": false,
"curl_proxyuserpwd": false,
"curl_encoding": "",
"is_streaming": false,
"streaming_eol": "\r\n",
"streaming_metrics_interval": 10,
"as_header": true,
"force_nonce": false,
"force_timestamp": false
},
"buffer": null,
"request_settings": {
"params": [
],
"headers": {
"0": "Content-Type: application\/x-www-form-urlencoded",
"Authorization": "OAuth oauth_consumer_key=\"REMOVE\", oauth_nonce=\"REMOVE\", oauth_signature=\"REMOVE\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1535036039\", oauth_token=\"REMOVE\", oauth_version=\"1.0\""
},
"with_user": true,
"multipart": false,
"method": "GET",
"without_bearer": true,
"url": "https:\/\/ads-api.twitter.com\/3\/accounts",
"oauth1_params": {
"oauth_consumer_key": "REMOVE",
"oauth_nonce": "REMOVE",
"oauth_signature": "REMOVE",
"oauth_signature_method": "HMAC-SHA1",
"oauth_timestamp": "1535036039",
"oauth_token": "REMOVE",
"oauth_version": "1.0"
},
"prepared_params": [
],
"basestring_params": "REMOVE",
"basestring": "REMOVE",
"signing_key": "REMOVE"
}
}
As you can see I removed the sensitive information due to the public nature of this post. I can provide the non-edited versions upon request.
Please help as I have customers with 3+ days of stale data in our platform.