[{"data":1,"prerenderedAt":1712},["ShallowReactive",2],{"navigation":3,"\u002Fnumbers":43,"\u002Fnumbers-surround":1707},[4,8,13,18,23,28,33,38],{"title":5,"path":6,"stem":7},"Getting started","\u002F","index",{"title":9,"path":10,"stem":11,"order":12},"Numbers","\u002Fnumbers","numbers",1,{"title":14,"path":15,"stem":16,"order":17},"Rent","\u002Frent","rent",2,{"title":19,"path":20,"stem":21,"order":22},"User","\u002Fuser","user",3,{"title":24,"path":25,"stem":26,"order":27},"Free numbers","\u002Ffree","free",4,{"title":29,"path":30,"stem":31,"order":32},"Webhooks","\u002Fwebhooks","webhooks",5,{"title":34,"path":35,"stem":36,"order":37},"Testing","\u002Ftesting","testing",6,{"title":39,"path":40,"stem":41,"order":42},"Changelog","\u002Fchangelog","changelog",7,{"id":44,"title":9,"body":45,"description":1701,"extension":1702,"meta":1703,"navigation":1704,"path":10,"seo":1705,"stem":11,"__hash__":1706},"docs\u002Fnumbers.md",{"type":46,"value":47,"toc":1688},"minimark",[48,99,103,110,154,216,257,270,272,275,307,374,425,449,451,457,487,505,561,566,569,576,618,708,742,850,852,855,885,955,963,965,968,1021,1162,1187,1251,1274,1276,1279,1297,1320,1331,1333,1340,1357,1380,1391,1393,1396,1413,1436,1446,1448,1457,1470,1487,1535,1537,1540,1562,1677,1684],[49,50,51,52,56,57,6,60,63,64,67,68,71,72,75,76,79,80,83,84,87,88,83,91,94,95,98],"p",{},"An operation (",[53,54,55],"code",{},"tzid",") is one ordered number. Order it with ",[53,58,59],{},"get",[53,61,62],{},"get_with_number",", read the SMS with ",[53,65,66],{},"state_one"," or ",[53,69,70],{},"wait_code",", finish it with ",[53,73,74],{},"close"," (or ",[53,77,78],{},"ban","). Countries are phone codes (",[53,81,82],{},"7",", ",[53,85,86],{},"44",", …), services are slugs (",[53,89,90],{},"google",[53,92,93],{},"vkcom",", …) as returned by ",[53,96,97],{},"tariffs",".",[100,101,102],"h2",{"id":102},"price",[49,104,105,106,109],{},"Price of one number, USD; ",[53,107,108],{},"nil"," when the country has no price for the service.",[111,112,117],"pre",{"className":113,"code":114,"language":115,"meta":116,"style":116},"language-ruby shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","price(service, country = 7) # => Float or nil\n","ruby","",[53,118,119],{"__ignoreMap":116},[120,121,123,126,130,134,137,140,143,147,150],"span",{"class":122,"line":12},"line",[120,124,102],{"class":125},"s2Zo4",[120,127,129],{"class":128},"sMK4o","(",[120,131,133],{"class":132},"sTEyZ","service",[120,135,136],{"class":128},",",[120,138,139],{"class":132}," country ",[120,141,142],{"class":128},"=",[120,144,146],{"class":145},"sbssI"," 7",[120,148,149],{"class":128},")",[120,151,153],{"class":152},"sHwdD"," # => Float or nil\n",[155,156,157,176],"table",{},[158,159,160],"thead",{},[161,162,163,167,170,173],"tr",{},[164,165,166],"th",{},"Param",[164,168,169],{},"Type",[164,171,172],{},"Default",[164,174,175],{},"Description",[177,178,179,197],"tbody",{},[161,180,181,186,191,194],{},[182,183,184],"td",{},[53,185,133],{},[182,187,188],{},[53,189,190],{},"String",[182,192,193],{},"—",[182,195,196],{},"Service slug.",[161,198,199,204,209,213],{},[182,200,201],{},[53,202,203],{},"country",[182,205,206],{},[53,207,208],{},"Integer",[182,210,211],{},[53,212,82],{},[182,214,215],{},"Country code.",[111,217,219],{"className":113,"code":218,"language":115,"meta":116,"style":116},"usd = client.numbers.price(\"google\", 44)\n",[53,220,221],{"__ignoreMap":116},[120,222,223,226,228,231,233,235,237,239,241,244,247,249,251,254],{"class":122,"line":12},[120,224,225],{"class":132},"usd ",[120,227,142],{"class":128},[120,229,230],{"class":132}," client",[120,232,98],{"class":128},[120,234,11],{"class":125},[120,236,98],{"class":128},[120,238,102],{"class":125},[120,240,129],{"class":128},[120,242,243],{"class":128},"\"",[120,245,90],{"class":246},"sfazB",[120,248,243],{"class":128},[120,250,136],{"class":128},[120,252,253],{"class":145}," 44",[120,255,256],{"class":128},")\n",[49,258,259,260,263,264,83,267,98],{},"Errors: ",[53,261,262],{},"ApiError"," ",[53,265,266],{},"ERROR_NO_SERVICE",[53,268,269],{},"UNDEFINED_COUNTRY",[100,271,59],{"id":59},[49,273,274],{},"Order a number; returns the operation id. Freezes the price on the balance.",[111,276,278],{"className":113,"code":277,"language":115,"meta":116,"style":116},"get(service, country = 7, reject: nil) # => Integer (tzid)\n",[53,279,280],{"__ignoreMap":116},[120,281,282,284,286,288,290,292,294,296,298,301,304],{"class":122,"line":12},[120,283,59],{"class":125},[120,285,129],{"class":128},[120,287,133],{"class":132},[120,289,136],{"class":128},[120,291,139],{"class":132},[120,293,142],{"class":128},[120,295,146],{"class":145},[120,297,136],{"class":128},[120,299,300],{"class":128}," reject:",[120,302,303],{"class":128}," nil)",[120,305,306],{"class":152}," # => Integer (tzid)\n",[155,308,309,321],{},[158,310,311],{},[161,312,313,315,317,319],{},[164,314,166],{},[164,316,169],{},[164,318,172],{},[164,320,175],{},[177,322,323,337,353],{},[161,324,325,329,333,335],{},[182,326,327],{},[53,328,133],{},[182,330,331],{},[53,332,190],{},[182,334,193],{},[182,336,196],{},[161,338,339,343,347,351],{},[182,340,341],{},[53,342,203],{},[182,344,345],{},[53,346,208],{},[182,348,349],{},[53,350,82],{},[182,352,215],{},[161,354,355,360,365,368],{},[182,356,357],{},[53,358,359],{},"reject:",[182,361,362],{},[53,363,364],{},"Array",[182,366,367],{},"profile list",[182,369,370,371,98],{},"Number prefixes to skip, e.g. ",[53,372,373],{},"[\"4470\"]",[111,375,377],{"className":113,"code":376,"language":115,"meta":116,"style":116},"tzid = client.numbers.get(\"google\", 44, reject: [\"4470\"])\n",[53,378,379],{"__ignoreMap":116},[120,380,381,384,386,388,390,392,394,396,398,400,402,404,406,408,410,412,415,417,420,422],{"class":122,"line":12},[120,382,383],{"class":132},"tzid ",[120,385,142],{"class":128},[120,387,230],{"class":132},[120,389,98],{"class":128},[120,391,11],{"class":125},[120,393,98],{"class":128},[120,395,59],{"class":125},[120,397,129],{"class":128},[120,399,243],{"class":128},[120,401,90],{"class":246},[120,403,243],{"class":128},[120,405,136],{"class":128},[120,407,253],{"class":145},[120,409,136],{"class":128},[120,411,300],{"class":128},[120,413,414],{"class":128}," [",[120,416,243],{"class":128},[120,418,419],{"class":246},"4470",[120,421,243],{"class":128},[120,423,424],{"class":128},"])\n",[49,426,259,427,430,431,263,433,83,436,83,438,83,440,83,443,83,446,98],{},[53,428,429],{},"NoNumberError","; ",[53,432,262],{},[53,434,435],{},"WARNING_LOW_BALANCE",[53,437,266],{},[53,439,269],{},[53,441,442],{},"EXCEEDED_CONCURRENT_OPERATIONS",[53,444,445],{},"INTERVAL_CONCURRENT_REQUESTS_ERROR",[53,447,448],{},"TRY_AGAIN_LATER",[100,450,62],{"id":62},[49,452,453,454,456],{},"Same as ",[53,455,59],{},", but returns the number right away.",[111,458,460],{"className":113,"code":459,"language":115,"meta":116,"style":116},"get_with_number(service, country = 7, reject: nil) # => Hash\n",[53,461,462],{"__ignoreMap":116},[120,463,464,466,468,470,472,474,476,478,480,482,484],{"class":122,"line":12},[120,465,62],{"class":125},[120,467,129],{"class":128},[120,469,133],{"class":132},[120,471,136],{"class":128},[120,473,139],{"class":132},[120,475,142],{"class":128},[120,477,146],{"class":145},[120,479,136],{"class":128},[120,481,300],{"class":128},[120,483,303],{"class":128},[120,485,486],{"class":152}," # => Hash\n",[49,488,489,490,493,494,497,498,83,501,504],{},"Returns ",[53,491,492],{},"{\"tzid\", \"number\", \"country\", \"time\", \"service\", \"title\"?, \"guard_interval_remaining_seconds\"?}"," — ",[53,495,496],{},"number"," with ",[53,499,500],{},"+",[53,502,503],{},"time"," in seconds left.",[111,506,508],{"className":113,"code":507,"language":115,"meta":116,"style":116},"order = client.numbers.get_with_number(\"google\", 44)\nputs order[\"number\"]\n",[53,509,510,541],{"__ignoreMap":116},[120,511,512,515,517,519,521,523,525,527,529,531,533,535,537,539],{"class":122,"line":12},[120,513,514],{"class":132},"order ",[120,516,142],{"class":128},[120,518,230],{"class":132},[120,520,98],{"class":128},[120,522,11],{"class":125},[120,524,98],{"class":128},[120,526,62],{"class":125},[120,528,129],{"class":128},[120,530,243],{"class":128},[120,532,90],{"class":246},[120,534,243],{"class":128},[120,536,136],{"class":128},[120,538,253],{"class":145},[120,540,256],{"class":128},[120,542,543,546,549,552,554,556,558],{"class":122,"line":17},[120,544,545],{"class":125},"puts",[120,547,548],{"class":132}," order",[120,550,551],{"class":128},"[",[120,553,243],{"class":128},[120,555,496],{"class":246},[120,557,243],{"class":128},[120,559,560],{"class":128},"]\n",[49,562,563,564,98],{},"Errors: as ",[53,565,59],{},[100,567,568],{"id":568},"state",[49,570,571,572,575],{},"All operations of the account; ",[53,573,574],{},"[]"," when there are none.",[111,577,579],{"className":113,"code":578,"language":115,"meta":116,"style":116},"state(message_to_code: true, order_by: \"asc\", msg_list: false) # => Array of Hash\n",[53,580,581],{"__ignoreMap":116},[120,582,583,585,588,592,594,597,600,603,605,607,610,613,615],{"class":122,"line":12},[120,584,568],{"class":125},[120,586,587],{"class":128},"(message_to_code:",[120,589,591],{"class":590},"sfNiH"," true",[120,593,136],{"class":128},[120,595,596],{"class":128}," order_by:",[120,598,599],{"class":128}," \"",[120,601,602],{"class":246},"asc",[120,604,243],{"class":128},[120,606,136],{"class":128},[120,608,609],{"class":128}," msg_list:",[120,611,612],{"class":590}," false",[120,614,149],{"class":128},[120,616,617],{"class":152}," # => Array of Hash\n",[155,619,620,633],{},[158,621,622],{},[161,623,624,627,629,631],{},[164,625,626],{},"Option",[164,628,169],{},[164,630,172],{},[164,632,175],{},[177,634,635,662,684],{},[161,636,637,642,647,652],{},[182,638,639],{},[53,640,641],{},"message_to_code:",[182,643,644],{},[53,645,646],{},"Boolean",[182,648,649],{},[53,650,651],{},"true",[182,653,654,657,658,661],{},[53,655,656],{},"msg"," is the code only; ",[53,659,660],{},"false"," — the full SMS text.",[161,663,664,669,677,681],{},[182,665,666],{},[53,667,668],{},"order_by:",[182,670,671,83,674],{},[53,672,673],{},"\"asc\"",[53,675,676],{},"\"desc\"",[182,678,679],{},[53,680,673],{},[182,682,683],{},"Order of operations.",[161,685,686,691,695,699],{},[182,687,688],{},[53,689,690],{},"msg_list:",[182,692,693],{},[53,694,646],{},[182,696,697],{},[53,698,660],{},[182,700,701,703,704,707],{},[53,702,656],{}," is a list of all SMS (",[53,705,706],{},"[{\"service\", \"msg\"}]",").",[49,709,710,711,714,715,718,719,722,723,726,727,730,731,734,735,738,739,741],{},"An operation: ",[53,712,713],{},"{\"tzid\", \"response\", \"number\"?, \"service\"?, \"country\"?, \"sum\"?, \"time\"?, \"msg\"?, \"guard_interval_remaining_seconds\"?, …}",".\n",[53,716,717],{},"response"," is the state: ",[53,720,721],{},"TZ_INPOOL"," (number being assigned), ",[53,724,725],{},"TZ_NUM_WAIT"," (waiting for SMS), ",[53,728,729],{},"TZ_NUM_ANSWER"," (SMS arrived), ",[53,732,733],{},"TZ_OVER_OK"," (finished), ",[53,736,737],{},"ERROR_NO_ITEMS"," (failed). ",[53,740,656],{}," is absent until the first SMS. The server caches answers for a few seconds.",[111,743,745],{"className":113,"code":744,"language":115,"meta":116,"style":116},"client.numbers.state(order_by: \"desc\").each do |op|\n  puts [op[\"tzid\"], op[\"response\"], op[\"msg\"]].join(\" \")\nend\n",[53,746,747,788,845],{"__ignoreMap":116},[120,748,749,752,754,756,758,760,763,765,768,770,772,775,779,782,785],{"class":122,"line":12},[120,750,751],{"class":132},"client",[120,753,98],{"class":128},[120,755,11],{"class":125},[120,757,98],{"class":128},[120,759,568],{"class":125},[120,761,762],{"class":128},"(order_by:",[120,764,599],{"class":128},[120,766,767],{"class":246},"desc",[120,769,243],{"class":128},[120,771,707],{"class":128},[120,773,774],{"class":125},"each",[120,776,778],{"class":777},"s7zQu"," do",[120,780,781],{"class":128}," |",[120,783,784],{"class":132},"op",[120,786,787],{"class":128},"|\n",[120,789,790,793,795,797,799,801,803,805,808,811,813,815,817,819,821,823,825,827,829,831,834,837,839,841,843],{"class":122,"line":17},[120,791,792],{"class":125},"  puts",[120,794,414],{"class":128},[120,796,784],{"class":132},[120,798,551],{"class":128},[120,800,243],{"class":128},[120,802,55],{"class":246},[120,804,243],{"class":128},[120,806,807],{"class":128},"],",[120,809,810],{"class":132}," op",[120,812,551],{"class":128},[120,814,243],{"class":128},[120,816,717],{"class":246},[120,818,243],{"class":128},[120,820,807],{"class":128},[120,822,810],{"class":132},[120,824,551],{"class":128},[120,826,243],{"class":128},[120,828,656],{"class":246},[120,830,243],{"class":128},[120,832,833],{"class":128},"]].",[120,835,836],{"class":125},"join",[120,838,129],{"class":128},[120,840,243],{"class":128},[120,842,599],{"class":128},[120,844,256],{"class":128},[120,846,847],{"class":122,"line":22},[120,848,849],{"class":777},"end\n",[100,851,66],{"id":66},[49,853,854],{},"One operation.",[111,856,858],{"className":113,"code":857,"language":115,"meta":116,"style":116},"state_one(tzid, message_to_code: true, msg_list: false) # => Hash\n",[53,859,860],{"__ignoreMap":116},[120,861,862,864,866,868,870,873,875,877,879,881,883],{"class":122,"line":12},[120,863,66],{"class":125},[120,865,129],{"class":128},[120,867,55],{"class":132},[120,869,136],{"class":128},[120,871,872],{"class":128}," message_to_code:",[120,874,591],{"class":590},[120,876,136],{"class":128},[120,878,609],{"class":128},[120,880,612],{"class":590},[120,882,149],{"class":128},[120,884,486],{"class":152},[111,886,888],{"className":113,"code":887,"language":115,"meta":116,"style":116},"op = client.numbers.state_one(tzid)\nputs op[\"msg\"] if op[\"response\"] == \"TZ_NUM_ANSWER\"\n",[53,889,890,913],{"__ignoreMap":116},[120,891,892,895,897,899,901,903,905,907,909,911],{"class":122,"line":12},[120,893,894],{"class":132},"op ",[120,896,142],{"class":128},[120,898,230],{"class":132},[120,900,98],{"class":128},[120,902,11],{"class":125},[120,904,98],{"class":128},[120,906,66],{"class":125},[120,908,129],{"class":128},[120,910,55],{"class":132},[120,912,256],{"class":128},[120,914,915,917,919,921,923,925,927,930,933,935,937,939,941,943,945,948,950,952],{"class":122,"line":17},[120,916,545],{"class":125},[120,918,810],{"class":132},[120,920,551],{"class":128},[120,922,243],{"class":128},[120,924,656],{"class":246},[120,926,243],{"class":128},[120,928,929],{"class":128},"]",[120,931,932],{"class":777}," if",[120,934,810],{"class":132},[120,936,551],{"class":128},[120,938,243],{"class":128},[120,940,717],{"class":246},[120,942,243],{"class":128},[120,944,929],{"class":128},[120,946,947],{"class":128}," ==",[120,949,599],{"class":128},[120,951,729],{"class":246},[120,953,954],{"class":128},"\"\n",[49,956,259,957,263,959,962],{},[53,958,262],{},[53,960,961],{},"ERROR_NO_OPERATIONS"," when the operation does not exist (any more).",[100,964,70],{"id":70},[49,966,967],{},"Poll the operation until a code arrives, then close it and return the code.",[111,969,971],{"className":113,"code":970,"language":115,"meta":116,"style":116},"wait_code(tzid, interval: 5, timeout: 600, keep_open: false, full_message: false, since: nil) # => String\n",[53,972,973],{"__ignoreMap":116},[120,974,975,977,979,981,983,986,989,991,994,997,999,1002,1004,1006,1009,1011,1013,1016,1018],{"class":122,"line":12},[120,976,70],{"class":125},[120,978,129],{"class":128},[120,980,55],{"class":132},[120,982,136],{"class":128},[120,984,985],{"class":128}," interval:",[120,987,988],{"class":145}," 5",[120,990,136],{"class":128},[120,992,993],{"class":128}," timeout:",[120,995,996],{"class":145}," 600",[120,998,136],{"class":128},[120,1000,1001],{"class":128}," keep_open:",[120,1003,612],{"class":590},[120,1005,136],{"class":128},[120,1007,1008],{"class":128}," full_message:",[120,1010,612],{"class":590},[120,1012,136],{"class":128},[120,1014,1015],{"class":128}," since:",[120,1017,303],{"class":128},[120,1019,1020],{"class":152}," # => String\n",[155,1022,1023,1035],{},[158,1024,1025],{},[161,1026,1027,1029,1031,1033],{},[164,1028,626],{},[164,1030,169],{},[164,1032,172],{},[164,1034,175],{},[177,1036,1037,1057,1076,1102,1120,1140],{},[161,1038,1039,1044,1049,1054],{},[182,1040,1041],{},[53,1042,1043],{},"interval:",[182,1045,1046],{},[53,1047,1048],{},"Numeric",[182,1050,1051],{},[53,1052,1053],{},"5",[182,1055,1056],{},"Poll interval, seconds.",[161,1058,1059,1064,1068,1073],{},[182,1060,1061],{},[53,1062,1063],{},"timeout:",[182,1065,1066],{},[53,1067,1048],{},[182,1069,1070],{},[53,1071,1072],{},"600",[182,1074,1075],{},"Give up after, seconds.",[161,1077,1078,1083,1087,1091],{},[182,1079,1080],{},[53,1081,1082],{},"keep_open:",[182,1084,1085],{},[53,1086,646],{},[182,1088,1089],{},[53,1090,660],{},[182,1092,1093,1094,1097,1098,1101],{},"Call ",[53,1095,1096],{},"next(tzid)"," instead of ",[53,1099,1100],{},"close(tzid)",", to wait for another SMS.",[161,1103,1104,1109,1113,1117],{},[182,1105,1106],{},[53,1107,1108],{},"full_message:",[182,1110,1111],{},[53,1112,646],{},[182,1114,1115],{},[53,1116,660],{},[182,1118,1119],{},"Return the full SMS text instead of the code.",[161,1121,1122,1127,1133,1137],{},[182,1123,1124],{},[53,1125,1126],{},"since:",[182,1128,1129,83,1131],{},[53,1130,190],{},[53,1132,108],{},[182,1134,1135],{},[53,1136,108],{},[182,1138,1139],{},"Ignore this value (the previous code).",[161,1141,1142,1150,1153,1159],{},[182,1143,1144,83,1147],{},[53,1145,1146],{},"sleep:",[53,1148,1149],{},"now:",[182,1151,1152],{},"callables",[182,1154,1155,1158],{},[53,1156,1157],{},"Kernel#sleep",", monotonic clock",[182,1160,1161],{},"Injectable for tests (seconds).",[49,1163,1164,1165,1168,1169,263,1171,1173,1174,1177,1178,1180,1181,1183,1184,98],{},"Transient errors are retried until the timeout: ",[53,1166,1167],{},"TransportError",", and ",[53,1170,262],{},[53,1172,448],{}," (the HTTP 429 rate limit), ",[53,1175,1176],{},"ERROR_UNDEFINED"," and ",[53,1179,445],{},". Any other ",[53,1182,262],{}," is raised at once. Also available as ",[53,1185,1186],{},"OnlineSim.wait_code(numbers, tzid, **options)",[111,1188,1190],{"className":113,"code":1189,"language":115,"meta":116,"style":116},"first = client.numbers.wait_code(tzid, keep_open: true)\nsecond = client.numbers.wait_code(tzid, since: first)\n",[53,1191,1192,1221],{"__ignoreMap":116},[120,1193,1194,1197,1199,1201,1203,1205,1207,1209,1211,1213,1215,1217,1219],{"class":122,"line":12},[120,1195,1196],{"class":132},"first ",[120,1198,142],{"class":128},[120,1200,230],{"class":132},[120,1202,98],{"class":128},[120,1204,11],{"class":125},[120,1206,98],{"class":128},[120,1208,70],{"class":125},[120,1210,129],{"class":128},[120,1212,55],{"class":132},[120,1214,136],{"class":128},[120,1216,1001],{"class":128},[120,1218,591],{"class":590},[120,1220,256],{"class":128},[120,1222,1223,1226,1228,1230,1232,1234,1236,1238,1240,1242,1244,1246,1249],{"class":122,"line":17},[120,1224,1225],{"class":132},"second ",[120,1227,142],{"class":128},[120,1229,230],{"class":132},[120,1231,98],{"class":128},[120,1233,11],{"class":125},[120,1235,98],{"class":128},[120,1237,70],{"class":125},[120,1239,129],{"class":128},[120,1241,55],{"class":132},[120,1243,136],{"class":128},[120,1245,1015],{"class":128},[120,1247,1248],{"class":132}," first",[120,1250,256],{"class":128},[49,1252,259,1253,430,1256,1258,1259,67,1261,1263,1264,1266,1267,6,1269,6,1271,98],{},[53,1254,1255],{},"TimeoutError",[53,1257,262],{}," with code ",[53,1260,733],{},[53,1262,737],{}," when the operation ended without a new code; any other ",[53,1265,262],{}," from ",[53,1268,66],{},[53,1270,74],{},[53,1272,1273],{},"next",[100,1275,1273],{"id":1273},[49,1277,1278],{},"Switch the operation to its next SMS and keep it open (for services that send several SMS).",[111,1280,1282],{"className":113,"code":1281,"language":115,"meta":116,"style":116},"next(tzid) # => true\n",[53,1283,1284],{"__ignoreMap":116},[120,1285,1286,1288,1290,1292,1294],{"class":122,"line":12},[120,1287,1273],{"class":777},[120,1289,129],{"class":128},[120,1291,55],{"class":132},[120,1293,149],{"class":128},[120,1295,1296],{"class":152}," # => true\n",[111,1298,1300],{"className":113,"code":1299,"language":115,"meta":116,"style":116},"client.numbers.next(tzid)\n",[53,1301,1302],{"__ignoreMap":116},[120,1303,1304,1306,1308,1310,1312,1314,1316,1318],{"class":122,"line":12},[120,1305,751],{"class":132},[120,1307,98],{"class":128},[120,1309,11],{"class":125},[120,1311,98],{"class":128},[120,1313,1273],{"class":125},[120,1315,129],{"class":128},[120,1317,55],{"class":132},[120,1319,256],{"class":128},[49,1321,259,1322,263,1324,1327,1328,98],{},[53,1323,262],{},[53,1325,1326],{},"ERROR_WRONG_TZID"," (not an operation of your account), ",[53,1329,1330],{},"ERROR_NO_TZID",[100,1332,74],{"id":74},[49,1334,1335,1336,1339],{},"Finish the operation. An operation without SMS can be closed only after its guard interval (",[53,1337,1338],{},"guard_interval_remaining_seconds","); every attempt locks the tzid for 5 s.",[111,1341,1343],{"className":113,"code":1342,"language":115,"meta":116,"style":116},"close(tzid) # => true\n",[53,1344,1345],{"__ignoreMap":116},[120,1346,1347,1349,1351,1353,1355],{"class":122,"line":12},[120,1348,74],{"class":125},[120,1350,129],{"class":128},[120,1352,55],{"class":132},[120,1354,149],{"class":128},[120,1356,1296],{"class":152},[111,1358,1360],{"className":113,"code":1359,"language":115,"meta":116,"style":116},"client.numbers.close(tzid)\n",[53,1361,1362],{"__ignoreMap":116},[120,1363,1364,1366,1368,1370,1372,1374,1376,1378],{"class":122,"line":12},[120,1365,751],{"class":132},[120,1367,98],{"class":128},[120,1369,11],{"class":125},[120,1371,98],{"class":128},[120,1373,74],{"class":125},[120,1375,129],{"class":128},[120,1377,55],{"class":132},[120,1379,256],{"class":128},[49,1381,259,1382,263,1384,83,1387,83,1389,98],{},[53,1383,262],{},[53,1385,1386],{},"NO_COMPLETE_TZID",[53,1388,445],{},[53,1390,1326],{},[100,1392,78],{"id":78},[49,1394,1395],{},"Finish the operation and report the number as bad. Only before any SMS arrived.",[111,1397,1399],{"className":113,"code":1398,"language":115,"meta":116,"style":116},"ban(tzid) # => true\n",[53,1400,1401],{"__ignoreMap":116},[120,1402,1403,1405,1407,1409,1411],{"class":122,"line":12},[120,1404,78],{"class":125},[120,1406,129],{"class":128},[120,1408,55],{"class":132},[120,1410,149],{"class":128},[120,1412,1296],{"class":152},[111,1414,1416],{"className":113,"code":1415,"language":115,"meta":116,"style":116},"client.numbers.ban(tzid)\n",[53,1417,1418],{"__ignoreMap":116},[120,1419,1420,1422,1424,1426,1428,1430,1432,1434],{"class":122,"line":12},[120,1421,751],{"class":132},[120,1423,98],{"class":128},[120,1425,11],{"class":125},[120,1427,98],{"class":128},[120,1429,78],{"class":125},[120,1431,129],{"class":128},[120,1433,55],{"class":132},[120,1435,256],{"class":128},[49,1437,563,1438,430,1440,1258,1442,1445],{},[53,1439,74],{},[53,1441,262],{},[53,1443,1444],{},"\"0\""," when the operation already has an SMS — nothing is changed then.",[100,1447,97],{"id":97},[49,1449,1450,1451,1453,1454,98],{},"Services, prices and stock of every country, keyed by country code (a ",[53,1452,190],{},"). No API key needed. The answer is large (a few MB); prefer ",[53,1455,1456],{},"tariffs_one",[111,1458,1460],{"className":113,"code":1459,"language":115,"meta":116,"style":116},"tariffs # => Hash of country code => Hash\n",[53,1461,1462],{"__ignoreMap":116},[120,1463,1464,1467],{"class":122,"line":12},[120,1465,1466],{"class":132},"tariffs ",[120,1468,1469],{"class":152},"# => Hash of country code => Hash\n",[49,1471,1472,1473,430,1476,1479,1480,1483,1484,98],{},"A country: ",[53,1474,1475],{},"{\"name\", \"locale_name\"?, \"position\", \"code\", \"other\"?, \"new\", \"enabled\", \"services\"}",[53,1477,1478],{},"services"," maps ",[53,1481,1482],{},"service_\u003Cslug>"," to ",[53,1485,1486],{},"{\"count\", \"popular\", \"code\", \"price\", \"id\", \"service\", \"slug\"}",[111,1488,1490],{"className":113,"code":1489,"language":115,"meta":116,"style":116},"all = client.numbers.tariffs\nputs \"#{all.size} countries\"\n",[53,1491,1492,1510],{"__ignoreMap":116},[120,1493,1494,1497,1499,1501,1503,1505,1507],{"class":122,"line":12},[120,1495,1496],{"class":132},"all ",[120,1498,142],{"class":128},[120,1500,230],{"class":132},[120,1502,98],{"class":128},[120,1504,11],{"class":125},[120,1506,98],{"class":128},[120,1508,1509],{"class":125},"tariffs\n",[120,1511,1512,1514,1516,1519,1522,1524,1527,1530,1533],{"class":122,"line":17},[120,1513,545],{"class":125},[120,1515,599],{"class":128},[120,1517,1518],{"class":128},"#{",[120,1520,1521],{"class":132},"all",[120,1523,98],{"class":128},[120,1525,1526],{"class":125},"size",[120,1528,1529],{"class":128},"}",[120,1531,1532],{"class":246}," countries",[120,1534,954],{"class":128},[100,1536,1456],{"id":1456},[49,1538,1539],{},"Services, prices and stock of one country.",[111,1541,1543],{"className":113,"code":1542,"language":115,"meta":116,"style":116},"tariffs_one(country = 7) # => Hash\n",[53,1544,1545],{"__ignoreMap":116},[120,1546,1547,1549,1551,1554,1556,1558,1560],{"class":122,"line":12},[120,1548,1456],{"class":125},[120,1550,129],{"class":128},[120,1552,1553],{"class":132},"country ",[120,1555,142],{"class":128},[120,1557,146],{"class":145},[120,1559,149],{"class":128},[120,1561,486],{"class":152},[111,1563,1565],{"className":113,"code":1564,"language":115,"meta":116,"style":116},"uk = client.numbers.tariffs_one(44)\nuk[\"services\"].each_value { |s| puts [s[\"slug\"], s[\"price\"], s[\"count\"]].join(\" \") }\n",[53,1566,1567,1590],{"__ignoreMap":116},[120,1568,1569,1572,1574,1576,1578,1580,1582,1584,1586,1588],{"class":122,"line":12},[120,1570,1571],{"class":132},"uk ",[120,1573,142],{"class":128},[120,1575,230],{"class":132},[120,1577,98],{"class":128},[120,1579,11],{"class":125},[120,1581,98],{"class":128},[120,1583,1456],{"class":125},[120,1585,129],{"class":128},[120,1587,86],{"class":145},[120,1589,256],{"class":128},[120,1591,1592,1595,1597,1599,1601,1603,1606,1609,1612,1614,1617,1620,1623,1625,1627,1629,1631,1634,1636,1638,1641,1643,1645,1647,1649,1651,1653,1655,1657,1660,1662,1664,1666,1668,1670,1672,1674],{"class":122,"line":17},[120,1593,1594],{"class":132},"uk",[120,1596,551],{"class":128},[120,1598,243],{"class":128},[120,1600,1478],{"class":246},[120,1602,243],{"class":128},[120,1604,1605],{"class":128},"].",[120,1607,1608],{"class":125},"each_value",[120,1610,1611],{"class":128}," {",[120,1613,781],{"class":128},[120,1615,1616],{"class":132},"s",[120,1618,1619],{"class":128},"|",[120,1621,1622],{"class":125}," puts",[120,1624,414],{"class":128},[120,1626,1616],{"class":132},[120,1628,551],{"class":128},[120,1630,243],{"class":128},[120,1632,1633],{"class":246},"slug",[120,1635,243],{"class":128},[120,1637,807],{"class":128},[120,1639,1640],{"class":132}," s",[120,1642,551],{"class":128},[120,1644,243],{"class":128},[120,1646,102],{"class":246},[120,1648,243],{"class":128},[120,1650,807],{"class":128},[120,1652,1640],{"class":132},[120,1654,551],{"class":128},[120,1656,243],{"class":128},[120,1658,1659],{"class":246},"count",[120,1661,243],{"class":128},[120,1663,833],{"class":128},[120,1665,836],{"class":125},[120,1667,129],{"class":128},[120,1669,243],{"class":128},[120,1671,599],{"class":128},[120,1673,149],{"class":128},[120,1675,1676],{"class":128}," }\n",[49,1678,259,1679,263,1681,98],{},[53,1680,262],{},[53,1682,1683],{},"NO_COUNTRY",[1685,1686,1687],"style",{},"html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}",{"title":116,"searchDepth":17,"depth":17,"links":1689},[1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700],{"id":102,"depth":17,"text":102},{"id":59,"depth":17,"text":59},{"id":62,"depth":17,"text":62},{"id":568,"depth":17,"text":568},{"id":66,"depth":17,"text":66},{"id":70,"depth":17,"text":70},{"id":1273,"depth":17,"text":1273},{"id":74,"depth":17,"text":74},{"id":78,"depth":17,"text":78},{"id":97,"depth":17,"text":97},{"id":1456,"depth":17,"text":1456},"Order a number, read its SMS, close it — client.numbers.","md",{},{"order":12},{"title":9,"description":1701},"nfYgsKq2zpJfLLM6mBSWyHgZAxWzk9L_cIbQEoQ5H5c",[1708,1710],{"title":24,"path":25,"stem":26,"description":1709,"order":27},"Public numbers and their SMS — client.free. No API key needed.",{"title":14,"path":15,"stem":16,"description":1711,"order":17},"Rent a number for days and receive every SMS sent to it — client.rent.",1795163990844]