Skip to content

Commit 854fc14

Browse files
authored
Merge pull request #71 from fbsamples/oembed-remove-access-token
Remove Access Token from oEmbed API
2 parents cb76419 + 3dad456 commit 854fc14

2 files changed

Lines changed: 3 additions & 28 deletions

File tree

postman/threads-api.postman_collection.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3343,18 +3343,6 @@
33433343
"key": "url",
33443344
"value": "https://www.threads.net/@threads/post/DCkkKl_OGb1",
33453345
"description": "This is the URL of the Threads post to be embedded. With standard access, you may embed posts from the @meta, @threads, @instagram, and @facebook accounts."
3346-
},
3347-
{
3348-
"key": "access_token",
3349-
"value": "TH|{{app_id}}|{{app_secret}}",
3350-
"description": "This is your app access token. This consists of your app's ID and secret.",
3351-
"disabled": true
3352-
},
3353-
{
3354-
"key": "access_token",
3355-
"value": "{{app_access_token}}",
3356-
"description": "This is your app access token received via the GET /oauth/access_token endpoint. See the Authorization folder for details.",
3357-
"disabled": true
33583346
}
33593347
]
33603348
}
@@ -3378,18 +3366,6 @@
33783366
"key": "url",
33793367
"value": "https://www.threads.net/@threads/post/DCkkKl_OGb1",
33803368
"description": "This is the URL of the Threads post to be embedded. With standard access, you may embed posts from the @meta, @threads, @instagram, and @facebook accounts."
3381-
},
3382-
{
3383-
"key": "access_token",
3384-
"value": "TH|{{app_id}}|{{app_secret}}",
3385-
"description": "This is your app access token. This consists of your app's ID and secret.",
3386-
"disabled": true
3387-
},
3388-
{
3389-
"key": "access_token",
3390-
"value": "{{app_access_token}}",
3391-
"description": "This is your app access token received via the GET /oauth/access_token endpoint. See the Authorization folder for details.",
3392-
"disabled": true
33933369
}
33943370
]
33953371
}

src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ const agent = new https.Agent({
122122
});
123123

124124
const GRAPH_API_BASE_URL =
125-
'https://graph.threads.net/' +
125+
'https://graph.threads.com/' +
126126
(GRAPH_API_VERSION ? GRAPH_API_VERSION + '/' : '');
127-
const AUTHORIZATION_BASE_URL = 'https://www.threads.net';
127+
const AUTHORIZATION_BASE_URL = 'https://www.threads.com';
128128

129129
let initial_access_token = INITIAL_ACCESS_TOKEN;
130130
let initial_user_id = INITIAL_USER_ID;
@@ -1117,8 +1117,7 @@ app.get('/oEmbed', async (req, res) => {
11171117
`oembed`,
11181118
{
11191119
url,
1120-
},
1121-
`TH|${APP_ID}|${API_SECRET}`
1120+
}
11221121
);
11231122

11241123
let html = '<p>Unable to embed</p>';

0 commit comments

Comments
 (0)