Instagram第三方接入
Instagram第三方接入
簡介
Instagram接入不需要SDK,后臺管理是和facebook一起的,主要是通過網頁接口來實現相關登錄,分享等功能
文檔
官方文檔:Instagram 圖譜 API - Instagram 平臺 (facebook.com)
后臺管理:所有應用 - Facebook 開發者
輔助文檔:iOS 使用Instagram授權登錄 - 簡書 (jianshu.com)
instagram授權流程(一) - 掘金 (juejin.cn)
(27條消息) Instagram API平臺文檔_AlbertYang的博客-CSDN博客
(27條消息) instagram授權流程(第二篇)_Android_Study_OK的博客-CSDN博客丞
流程
1、在后臺管理中,創建應用,選擇消費者
2、客戶端使用uniwebview做網頁訪問
3、權限請求
請求的URI:
https://api.instagram.com/oauth/authorize?client_id={0}&scope=user_profile&redirect_uri={1}&response_type=code4、重定向
需要在重定向地址接收,這里我用的uniwebview,所以我直接解析返回的URI,獲取到我所需要的數據。
5、用戶申請
https://api.instagram.com/oauth/access_token使用的POST請求,參數如下:
Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("client_id", INSTAGRAM_ID.ToString()); dic.Add("client_secret", INSTAGRAM_SECRET); dic.Add("code", _authCode); //從重定向的uri返回的數據中獲取 dic.Add("redirect_uri", REDIRECT_URI); dic.Add("grant_type", "authorization_code");6、獲取用戶信息
/// <summary> /// 獲取用戶信息 /// </summary> public const string USER_URI = "https://graph.instagram.com/me";/// <summary> /// 獲取用戶媒體信息 /// </summary> public const string USER_MEDIA_URI = "https://graph.instagram.com/me/media";參數
?fields=id,username&access_token=access_token從上一步返回的數據中獲取。
注意事項
1、如果不適用uniwebview,則需要在你的redirect_uri中,接收instagram返回的數據,并根據實際需求,將相應的參數發送給app或者網頁等。
尾語
寫的不是很清楚,如果大家有不懂的地方或者寫的有不對的地方,歡迎大家留言。
總結
以上是生活随笔為你收集整理的Instagram第三方接入的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: X99-DELUXE II 无线网卡li
- 下一篇: PS4计算机模块试题,越玩越留恋的PS4