Areadrm သည် Open source ဖောက်သည်ဆက်ဆံရေးစီမံခန့်ခွဲမှု (CRM) software ဖြစ်သည်။ ဤဆောင်းပါးသည် PHP ကို API Communter ကိုတည်ဆောက်ရန်နှင့်ဤ interface ကိုလျင်မြန်စွာပေါင်းစပ်။ အသုံးပြုရန်အတွက်အသေးစိတ်ကုဒ်များကိုအသေးစိတ်ဖော်ပြရန်မည်သို့အသုံးပြုရမည်ကိုပြသပါမည်။
KEATECRM ၏ API interface ကိုမစတင်မှီ, ဆာဗာပေါ်ရှိ key ကိုတပ်ဆင်ပြီး API key ကို configure လုပ်ရန်ပထမ ဦး စွာသင်ပထမ ဦး ဆုံးလိုအပ်သည်။ API သော့များသည် interface ဖုန်းခေါ်ဆိုသောအခါလိုအပ်သော authentication information လိုအပ်သည်။ API သော့များကိုထုတ်လုပ်ရန်နှင့်စီမံရန် APICRM ၏စီမံခန့်ခွဲရေးမျက်နှာပြင်တွင် API ချိန်ညှိချက်များရွေးချယ်မှုများကိုသင်ရှာနိုင်သည်။
PHP တွင်သင်နှင့်ချိတ်ဆက်ရန် HTTP တောင်းဆိုမှုများကိုစတင်ရန်သင်ခန်းစာကိုသုံးနိုင်သည်။ အောက်ဖော်ပြပါကုဒ်သည် condle condition object တစ်ခုကိုမည်သို့ဖန်တီးရမည်ကိုပြသပြီး API အဆုံးမှတ် URL, တောင်းဆိုမှုနည်းလမ်းနှင့် authentication ၏အချက်အလက်များကဲ့သို့သောတောင်းဆိုမှု၏အခြေခံ parameters များကိုလည်းပြသသည်။
$ apiurl = 'https://your-suitecrm-instance.com/service/v4_1/rest.php' '; $ username = 'သင်၏အသုံးပြုသူအမည်', $ စကားဝှက် = 'သင်၏စကားဝှက်', $ curl = curl_init (); curl_setopt ($ curl, curlopt_URL, $ apiurl); curl_setopt ($ curl, curlopt_rreturntransfer, စစ်မှန်သော); curl_setopt ($ curl, curlopt_hteader, 'Content-type: application / JSONS', 'Accept: လျှောက်လွှာ / JSONS', ]); curl_setopt ($ curl, curlopt_httpauth, curlauth_basic); curl_setopt ($ curl, curlopt_userpwd, $ username ':': '။ $ စကားဝှက်);
Kypeecrm နှင့်အပြန်အလှန်ဆက်သွယ်သောအခါသင်လိုအပ်သော API အဆုံးတွင် HTTP တောင်းဆိုမှုကိုပေးပို့ရန်လိုအပ်သည်။ ဆက်သွယ်ရန်အချက်အလက်အားလုံးကို Attoecrm ရှိဆက်သွယ်ရန်အချက်အလက်အားလုံးကိုရယူရန် Curl ကိုမည်သို့အသုံးပြုရမည်ကိုဖော်ပြသည့်ဥပမာတစ်ခုမှာဤတွင်ဖော်ပြထားသည်။
$ imimethod = 'get_entry_list'; $ Modulename = 'အဆက်အသွယ်များ'; $ params = [ 'session' => '', 'Module_name' => $ Modulename, 'query' => '', 'order_by' => '', 'offset' => 0, 'Select_FirefiField' => ['id' ',' first_name ',' last_name ',' email '], 'max_results' => 10, 'ဖျက်ပစ်' => 0, ]; curl_setopt ($ curl, curlopt_post, true); curl_setopt ($ curl, curlopt_postfields, json_entode ([ 'method' => iFimethod, 'input_type' => 'JSONS', 'Response_type' => 'JSONS', 'Rest_Data' => JSONS_CENCODED ($ params), )))))) $ တုံ့ပြန်မှု = curl_exec ($ curl);
Kingecrm API interface မှပြန်လာသောအချက်အလက်များသည်များသောအားဖြင့် JSOS format တွင်များသောအားဖြင့် PHP ၏ JSONS_Decode function ကို အသုံးပြု. PHP ၏ JSOS_Decode function ကို အသုံးပြု. ခင်းကျင်းရန်လိုအပ်သည်။
$ ReavoredAne = JSON_Decode ($ တုံ့ပြန်မှု, စစ်မှန်သော); IF ($ Readsfeedata ['အမည်'] == 'မမှန်ကန်သော session id') { // မမှန်ကန်သော session id ၏အခြေအနေကိုကိုင်တွယ်ပါ။ } အခြား $ ဒေတာ = $ Revieweedata ['entry_list']; foreach ($ ဒေတာ $ entry ကိုအဖြစ်) { $ ID = $ entry ['ID'] ['value']; $ firstname = $ entry ['first_name'] ['value']; $ alcername = $ entry ['last_name'] ['value']; $ email = $ entry ['email'] ['value']; // ဖြစ်စဉ်ကိုဆက်သွယ်ရန်အချက်အလက် // ... } }
အထက်ပါအဆင့်များမှတစ်ဆင့် PHP ကို အသုံးပြု. API interface ကိုမည်သို့တည်ဆောက်ရမည်ကိုသင်လေ့လာခဲ့ပြီ။ API နှင့်အတူသင် CRM စနစ်နှင့်အလွယ်တကူအပြန်အလှန်ဆက်သွယ်နိုင်ပြီးသင်၏စီးပွားရေးလုပ်ငန်း၏ဖောက်သည်များ၏စီမံခန့်ခွဲမှုစွမ်းဆောင်ရည်ကိုတိုးတက်အောင်လုပ်နိုင်သည်။ ဤဆောင်းပါး၏အကြောင်းအရာသည်သင်အတွက်အထောက်အကူဖြစ်လိမ့်မည်ဟုကျွန်ုပ်မျှော်လင့်ပါသည်။