1
我正在嘗試Instagram用戶關注並取消關注我的網站。我正在使用Instagram API + codeignator來執行此操作。在前端,我列出的Instagram用戶與「跟隨」&「跟隨」按鈕。 當用戶關注並且他們點擊「關注」時,它應該「取消關注」用戶。 當按鈕顯示「Follow」並且用戶點擊它時,按鈕應該改變爲以下並開始跟隨用戶。 我加入,我沒有代碼:我如何關注&取消關注使用Instagram API的Instagram用戶
$follow_id =$_POST['id'];
$accessToken = @$this->session->userdata('instagram_accessTokeninst');
$url= 'https://api.instagram.com/v1/users/'.$follow_id.'/relationship?access_token='.$accessToken;
$data = 'action=follow';
$resultObj = json_decode(sendPostData($url,$data));
print_r($resultObj);
$responseCode = $resultObj->meta->code;
$errorMsg = $resultObj->meta->error_message;
對於這樣的迴應,我得到一個「內部服務器錯誤」。 這段代碼是否適合我的要求。 等待您的答案...
好的,我會檢查這個。 – Sinto