From e6cf0edd1c66ffebf7bb2e15514d7bbac0ba9787 Mon Sep 17 00:00:00 2001 From: Magnus Burton Date: Mon, 4 Dec 2017 20:38:44 +0100 Subject: [PATCH] Updated Graph API version --- lib/BootBot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/BootBot.js b/lib/BootBot.js index 9808bb8..105f6a0 100644 --- a/lib/BootBot.js +++ b/lib/BootBot.js @@ -139,7 +139,7 @@ class BootBot extends EventEmitter { sendRequest(body, endpoint, method) { endpoint = endpoint || 'messages'; method = method || 'POST'; - return fetch(`https://graph.facebook.com/v2.6/me/${endpoint}?access_token=${this.accessToken}`, { + return fetch(`https://graph.facebook.com/v2.11/me/${endpoint}?access_token=${this.accessToken}`, { method, headers: { 'Content-Type': 'application/json' @@ -183,7 +183,7 @@ class BootBot extends EventEmitter { } getUserProfile(userId) { - const url = `https://graph.facebook.com/v2.6/${userId}?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=${this.accessToken}`; + const url = `https://graph.facebook.com/v2.11/${userId}?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=${this.accessToken}`; return fetch(url) .then(res => res.json()) .catch(err => console.log(`Error getting user profile: ${err}`));