"API «Битрикс24» — разбор с пристрастием". Александр Сербул, 1С-Битрикс

  • View
    3.468

  • Download
    21

Embed Size (px)

DESCRIPTION

24 API, . , , , , . . . , .

Transcript

  • 1. API24-, 1- AlexSerbul

2. 24API 3. .. 2010 . 1000 . 4. 24- C 2013 . 5. Scrum + SMS = ! ;-) 24- 6. iframe 24- 7. RESTAPI24: , email,push.,desktopapp. CRM () 24RESTAPI 8. RFC6749-J OAuth2.0-PHP. ow4.1.AuthorizaDonCodeGrant. 1.3.1.AuthorizaqonCode30. 3.3.AccessTokenScope, 6.RefreshinganAccessTokenAccessToken,1 7.1.AccessTokenTypes(),MAC OAuth2.0 9. 1) html+js+ 24 2) -iframe ;iframe- / 3) -API24 , . 10. : URI iframe (scope) API Access Token OAuth2.0AccessTokenScope 11. 1.hps://my.bitrix24.ru/oauth/authorize/? client_id=First_APP& response_type=code& redirect_uri=h"ps://test.com/bitrix/oauth/oauth_test.php 2.hps://test.com/bitrix/oauth/oauth_test.php? code=xxxxxxxxxxxxxxxxxxxxxxxxxxx 3.hps://my.bitrix24.ru/oauth/token/? client_id=First_APP& grant_type=authorizaqon_code& client_secret=#secret_key#& redirect_uri=h"ps://test.com/bitrix/oauth/oauth_test.php& code=xxxxxxxxxxxxxxxxxxxxxxxxxxx& scope=user 4.hps://test.com/bitrix/oauth/oauth_test.php? access_token=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 5.hps://my.bitrix24.ru/rest/methods.json? auth=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy&full=true {"result":["methods","batch","calendar.event.get",]} -AuthorizaqonCodeGrant 12. hps://_.bitrix24.ru/oauth/token/? grant_type=authorizaqon_code& client_id=_& client_secret=__& code=& scope=__& redirect_uri=URL_ { "access_token":"_","expires_in":3600, "scope":"_","refresh_token":"__", "domain":"_","member_id":"_ } hps://_.bitrix24.ru/oauth/token/? grant_type=refresh_token& client_id=_& client_secret=__& refresh_token=__& scope=__& redirect_uri=URL_ AccessToken 13. https://_24.bitrix24.{ru|en|de}/rest/_.? _& auth=_ https://my.bitrix24.ru/rest/methods.xml?auth=d161f25928c3184678924ec127edd29a - xml. https://my.bitrix24.ru/rest/entity.item.get.json?ENTITY=menu&auth=d161f25928c3184678924ec127edd29a - json menu. { "result": , "error": , "total": , "next": , } { "result": , "result_error": , "result_total": , "result_next": , next . } /RESTAPI 14. callbacks JS-API24 15. API: BX24.callMethod('user.get', {ID: 10}, function(res){ if(res.data()) { var user = res.data()[0]; if(user) alert(' ' + user.ID + ' ' + user.NAME); } }); JS-API24 Batch: BX24.callBatch({ get_user: ['user.current', {}], get_department: { method: 'department.get', params: { ID: '$result[get_user] [UF_DEPARTMENT]' } } }, function(result) { var l = result.get_department.data().length; var str = ' ' + result.get_user.data().NAME + ' ' + result.get_user.data().LAST_NAME + ' ' + (l > 1 ? ' ' : ' '); for(var i = 0; i < l; i++) { str += i == 0 ? '' : ', '; str += result.get_department.data()[i].NAME; } alert(str); }); 16. base64
send file from input
send static file