# 上傳GIF供FB預覽 使用 GIPHY developers 上傳 gif ,拿到的網址可轉址到活動網址 #### 限制:一定會先轉址到 GLPHY 頁面 、 手機板操作困難度過高 ## 登入 GIPHY developers 、 創建 APP > 網址: https://developers.giphy.com/ 用 rdartgital FB 帳號登入即可 開啟 dashboard ![](https://i.imgur.com/7IYvU62.png) 新增 App (我選擇 API ) ![](https://i.imgur.com/dhG9zZZ.png) 填寫名字和描述 ( 隨意 ) ![](https://i.imgur.com/PklDLbv.png) 拿到 API 的 Key ![](https://i.imgur.com/Dg57Sdo.png) ## 呼叫 API > API 文件: https://developers.giphy.com/docs/api#quick-start-guide ``` //javascript, jQuery var xhr = $.post("http://upload.giphy.com/v1/gifs", { api_key: "YOUR_API_KEY", // required username: "rdartgital", source_image_url: "YOUR_IMAGE_URL", source_post_url:"YOUR_SITE_URL", tags: "te,test2,test3" // ,file:'' // string(binary) }); xhr.done(function(data) { console.log("success got data", data); }); ``` ``` //javascript, jQuery var xhr = $.get("https://api.giphy.com/v1/gifs/YOUR_OBGECT_ID?api_key=YOUR_API_KEY"); xhr.done(function(data) { console.log("success got data", data); }); ``` 回傳的 bitly_url 即 gif 網址