Взаимодействие приложения с API
Стандартное взаимодействие приложения с API ВКонтакте производится путем создания HTTP-запроса (POST или GET) к http://api.vkontakte.ru/api.php.
Сервер принимает не более трёх запросов в секунду, содержащих одинаковые параметры api_id и viewer_id. То есть запущенное конкретным пользователем приложение не должно отправлять более трёх запросов в секунду, в противном случае сервер возвращает ошибку "Too many requests per second".
Для обращения к методам API, требующих наличия стороннего сервера, необходимо использовать взаимодействие по безопасной схеме.
Какие параметры необходимо передавать при запросе?
Название параметра Обязательный параметр Описание
api_id - идентификатор приложения, присваивается при создании.
method - название метода API из общего списка функций.
sig - подпись, которая создается в целях безопасности. Порядок создания подписи описан ниже.
v - версия API, текущая версия равна 2.0.
format - формат возвращаемых данных – XML или JSON. По умолчанию XML.
test_mode - если этот параметр равен 1, разрешает тестовые запросы к данным приложения. При этом аутентификация не проводится и считается, что текущий пользователь – это автор приложения. Это позволяет тестировать приложение без загрузки его на сайт. По умолчанию 0.
Как создавать подпись запроса?
Параметр sig равен md5 от конкатенации следующих строк:
viewer_id – id текущего пользователя, переданный SWF посредством flashvars при инициализации.
пар "parameter_name=parameter_value", расположенных в порядке возрастания имени параметра (по алфавиту).
секрета приложения api_secret (секрет Вы можете менять при редактировании страницы приложения).
sig = md5(viewer_idname1=value1name2=value2secret)
В данном случае sig равен md5("6492api_id=4method=getFriendsv=2.0secret") то есть b499ce268e9995a08b2f2aebff2488be
Пример запроса:
http://api.vkontakte.ru/api.php?api_id=4&v=2.0&method=getFriends&sig=b499ce268e9995a08b2f2aebff2488be
В данном случае API получает запрос getFriends ("вернуть список друзей текущего пользователя").
Пример ответа:
<response> <uid>1</uid> <uid>6</uid> <uid>6492</uid> </response>
Ответ по умолчанию приходит в формате XML в кодировке UTF-8.
Если же приходит сообщение об ошибке, то ответ мог бы выглядеть, например, следующим образом:
<error> <error_code>4</error_code> <error_msg>Incorrect signature</error_msg>
<request_params list="true">
<param><key>api_id</key><value>4</value></param>
<param><key>sig</key><value>b499ce268e9995a08b2f2aebff2488be</value></param>
</request_params>
</error>
Коды ошибок
Код ошибки Описание 1 Unknown error occured. 2 Application is disabled. Enable your application or use test mode. 3 Unknown method passed. 4 Incorrect signature. 5 User authorization failed.
Комментарии
блин. это всё я и на сайте
блин. это всё я и на сайте контакта могу прочитать! даёшь примеры!
jHdnOF ydnswglqaycr,
jHdnOF ydnswglqaycr, [url=http://izmgsngrmteh.com/]izmgsngrmteh[/url], [link=http://wehfutmkfvkk.com/]wehfutmkfvkk[/link], http://atkzlmecgsrt.com/
HmK1V2 wgrztfvkhtdi,
HmK1V2 wgrztfvkhtdi, [url=http://hlikvjparpfc.com/]hlikvjparpfc[/url], [link=http://pmcbpdtaubjo.com/]pmcbpdtaubjo[/link], http://vrmwhadmkyub.com/
comment2, 500 antabuse mg,
comment2, 500 antabuse mg, phentermine, us marlboro cigarettes, lasix sr tablet, meridia package insert, alprazolam hypnosis, ambien, adipex diet supplements, cheap acomplia, zithromax 500mg, zolpidem,
comment6, discount
comment6, discount phentermine, cost of xanax, cheap generic meridia, common withdrawal effects celexa, ambien and spasm medication, adipex, klonopin valium, cymbalta, ativan, tetracycline, retin a micro, reductil,
comment5, acomplia buy
comment5, acomplia buy rimonabant, canadian pharmacy phentermine, antabuse no online prescription, meridia, zolpidem ambien, buy propecia, cialis genuinerx.net viagra,
comment1, cheap 37 5
comment1, cheap 37 5 phentermine, cialis 60 pills, marlboro cigarettes, celexa, zolpidem 5 mg, ambien erectile dysfunction, levitra, viagra, klonopin drowsiness, viagra online, generic cialis, oxytetracycline, retin a,
comment2, buy cialis online,
comment2, buy cialis online, propecia forum, order viagra, online consultation viagra, zithromax tablet 250 mg 500 mg,
comment6, lasix potassium, us
comment6, lasix potassium, us marlboro cigarettes, ambien, viagra fact sheet, viagra 6 free samples, cook zolpidem,
comment5, 20mg of rimonabant,
comment5, 20mg of rimonabant, buy no phentermine prescription, xanax, ciprapine, zolpidem, book buy, cigarettes buy online, cheap adipex, cialis tadalafil, viagra, order tetracycline, reductil for slimming,
comment1, lasix, celexa
comment1, lasix, celexa pharmacy purchase, propecia without a prescription, levitra 30 pills, buy cigarettes, camel cigarette catalog, viagra plus 30 pills, viagra online, cialis super active 20 mg, ativan overdose symptoms, viagra super active 120 pills, zithromax chlamydia, minoxidil retin a,
comment1, cialis online from,
comment1, cialis online from, online cigarettes, diet pill acomplia also called rimonaban, klonopin, tetracycline, levitra, order tetracycline,
comment5, cialis levitra
comment5, cialis levitra viagra, viagra, cheap viagra, levitra link, rimonabant, parliament cigarette taste, xanax, zolpidem, antabuse 500mg,
comment6, winston cigarettes
comment6, winston cigarettes news, viagra professional 100mg, cheap viagra, parliament cigarette taste, accutane, lasix,
comment1, phentermine 37 5mg,
comment1, phentermine 37 5mg, ativan, parliament cigarette, meridia, the cheapest rimonabant, lasix danger,
comment6, viagra equivalent,
comment6, viagra equivalent, acomplia loss weight, natural viagra, medications ativan, online medication viagra, levitra 2 pills, order rimonabant, bethin, 1000 cigarettes, zolpidem lover, antabuse, buy phentermine no script, the cheapest rimonabant, lasix 60 pills,
comment1, cialis online
comment1, cialis online pharmacy, viagra online usa, cheap rimonabant online, order accutane, absolute cheapest cialis,
comment5, zmax, acomplia,
comment5, zmax, acomplia, book buy generic, acomplia online order, xanax or alprazolam, is meridia an amphetamine, generic propecia,
comment2, cialis, how does
comment2, cialis, how does viagra work, ativan, viagra no prescription, information on reductil, lasix pre surgical, acomplia aventis rimonabant sanofi, cheapest cigarettes, klonopin, levitra, antabuse, cialis kaufen.pagina.de link, phentermine,
comment5, atlanta accutane
comment5, atlanta accutane side effects, cialis, winston cigarette addatives, 2003 cyalis levitra market sales viagra, ativan, side effects zolpidem, cheap accutane, tetracycline, levitra, antabuse herb like that work, tetracycline online, allergic lasix protocol,
comment3, generic cialis
comment3, generic cialis online, winston, viagra, buy reductil, acomplia amp phentermine diet pills, free cialis,
comment5, cialis, lasix for
comment5, cialis, lasix for horse, buy propecia no, propecia online cheap, viagra,
comment2, phentermine without
comment2, phentermine without a prescription, cytotec, zolpidem tartrate cr, levitra, cheap real propecia, klonopin high last, affect side zithromax, ativan suppliers, contraindications enrofloxacin zithromax,
comment5, cytotec, viagra
comment5, cytotec, viagra cialis, buy levitra, cigarettes, cheap retin-a, adipex, buy adipex, viagra overnight cheap, cheap cymbalta, retin a wrinkle,
comment1, ambien humor,
comment1, ambien humor, adipex, canda viagra online, cialis generic viagra, duloxetine,, zithromax online, order viagra, ativan,
comment3, xanax, lasix, drug
comment3, xanax, lasix, drug meridia dangerous, zolpidem abuse, buy ambien, retin a opinion, discounted adipex, buy cigarettes online, generic viagra overnight delivery, acomplia fat cells, cheap zithromax, accutane,
comment1, slimona,
comment1, slimona, cytotechnology salary, lasix, meridia, mail order levitra, tax free cigarettes, klonopin drug, viagra, cialis generic levitra viagra, cymbalta prescription, zolpidem buy online, herbal viagra, retin a info,
comment1, cialis, bulk
comment1, cialis, bulk alprazolam, reductil side effects, lasix eye surgery, rimonabant for sell, cigarettes online, xanax, antabuse herb like that work, phentermine prescription, 40 buy lasix mg, buy adipex,
comment5, cialis, buying fake
comment5, cialis, buying fake viagra, cheapest reductil, lasix use, acomplia, buy tetracycline, buy lasix online,
comment4, cheap cialis,
comment4, cheap cialis, viagra cheap, cheap acomplia, viagra, ambien cr length of effectiveness, levitra buy, rimonabant online prices, zolpidem buy online, levitra 20 mg, cheap 37 5 phentermine,
comment6, accutane, order
comment6, accutane, order viagra, cheap nonprescription viagra, no prescription viagra, buy uk reductil,, parliament cigarettes, xanax yahoo, smoking more cigarettes, zolpidem price, accutane topical gel, meridia, buy cialis, lasix online,
comment4, celexa, diet drug
comment4, celexa, diet drug meridia, alprazolam, effects levitra side, buy cialis, accutane,
comment1, buy xanax, buy
comment1, buy xanax, buy celexa, zolpidem addiction, line prescription viagra, order cialis without, ativan picture, tetracycline,
comment1, cytotechnologist
comment1, cytotechnologist jobs, levitra 90 pills, lasix surgery, propecia, order propecia online, non prescription ambien, cigarettes, camel cigarettes, zithromax tri pak strep throat, buy reductil,
comment1, rimonabant 60
comment1, rimonabant 60 pills, cytotechnologist jobs, lasix, alprazolam, viagra wholesale, non prescription viagra, order acomplia, accutane,
comment3, phentermine, buy
comment3, phentermine, buy cytotec, cialis online, xanax, propecia testimonials, europe discount cigarettes, adipex p, klonopin, cheap acomplia, cymbalta loss weight, buy zolpidem, ativan, reductil uk,
comment2, online store
comment2, online store cialis, buy meridia, alprazolam no rx, instructions for using retin a, adipex, over the counter viagra, online viagra, price of cialis, acomplia 20mg, viagra alternative, zolpidem cr, zithromax, buy reductil,
comment5, accutane and
comment5, accutane and alcohol, cialis order, viagra 30 pills, cigarette kool winston, rimonabant acomplia, cigarettes marlboro tobacco, levitra 60 pills, rimoslim,
comment2, retin a enzyme,
comment2, retin a enzyme, ativan, zolpidem tartrate, 250 antabuse cheap generic mg online order, antabuse no online prescription, lasix side effects,
comment4, rebate zithromax,
comment4, rebate zithromax, acomplia sanofi, phentermine without prescription, online pharmacy us ambien, acomplia fat cells, amoxicillin tetracycline vs, drug antabuse, buy phentermine online,
comment1, suiside ativan,
comment1, suiside ativan, levitra, purchase lasix online, levitra 120 pills, phentermine smoke, cheap propecia usa, cialis,
comment3, serum range
comment3, serum range alprazolam, online cialis, zithromax antibiotic medication, phentermine no script overnight, ambien hallucinations, rimonabant, buy phentermine acomplia, make xanax, cigarettes, zolpidem, meridia, phentermine, propecia, phentermine adipex-p,
comment5, cytotec,
comment5, cytotec, prescritpion phentermine, buy cialis online, levitra buy, celexa interaction, zolpidem, propecia canada, buy alprazolam, should ambien be banned, viagra soft tabs 30 pills, cheapest cialis, accutane taxol interferon, zolpidem, johnson stevens syndrome tetracycline,
comment2, reductil side
comment2, reductil side effects, acomplia no prescription, rimonabant 270 pills, levitra 20 pills, antabuse, cialis online from,
comment4, buying viagra,
comment4, buying viagra, acomplia slimming tablet, zolpidem, how does accutane work, meridias capital,
comment4, zithromax, natural
comment4, zithromax, natural viagra, zithromax, generic for valtrex, meridia with wellbutrin interactions, cytotec es que, order levitra, zolpidem picture, cheap propecia, lexapro zyprexa, effects side tetracycline, propranolol used for, adipex ingredients, antabuse alcohol,
comment6, latest news on
comment6, latest news on vytorin, viagra pills, isotane, reductil slimming pill, propranolol, retin a and freckle,
comment3, buy cialis,
comment3, buy cialis, cytotec, summary of accutane labeling, ambien, zolpidem, xanax, alcoholism antabuse medication,
comment5, phentermine no
comment5, phentermine no prescription, buy levitra online, zolpidem 5 mg, acomplia buy rimonabant, levitra, lexapro combined with, accutane treatment, levitra 90 pills, tetracycline stain on tooth, antabuse,
comment4, meridia, vytorin 10
comment4, meridia, vytorin 10 40, brasilia cytotec, zolpidem addiction, accutane, viagra, pill rimonabant, viagra cialis levitra, buy zolpidem, reductil, drug crestor, buy ativan, effects propranolol side,
Отправить комментарий