25
loading...
This website collects cookies to deliver better user experience
The goal of this article is to help you connect to each of these site's APIs in order to programmatically post, update, and enjoy with these services.
This gets old fast.
Documentation - https://github.com/Medium/medium-api-docs
![]() |
---|
Medium's integration token panel |
GET https://api.medium.com/v1/me
to get the authenticated user data.fetch('https://api.medium.com/v1/me', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer <AUTHENTICATION TOKEN HERE>',
},
})
.then(res => res.json())
.then(res => console.log(JSON.stringify(res)))
id
. You will want to save this ID value because it will be required to create a Medium article using NodeJS.POST https://api.medium.com/v1/users/{{authorId}}/posts
. The documentation posted above goes into detail on what parameters are required and/or available.contentFormat
field to either markdown
or html
.fetch('https://api.medium.com/v1/users/<USER-ID>/posts', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer <REPLACE WITH TOKEN GENERATED ABOVE>',
},
body: JSON.stringify({
title: 'Liverpool FC',
contentFormat: 'markdown',
content: '# You can put Markdown here.\n***\nSee what it looks like?',
canonicalUrl: 'http://jamietalbot.com/posts/liverpool-fc',
tags: ['football', 'sport', 'Liverpool'],
publishStatus: 'public',
}),
})
.then(res => res.json())
.then(res => console.log(JSON.stringify(res)))
GET https://api.medium.com/v1/me
GET https://api.medium.com/v1/users/{{userId}}/publications
GET https://api.medium.com/v1/publications/{{publicationId}}/contributors
POST https://api.medium.com/v1/users/{{authorId}}/posts
POST https://api.medium.com/v1/publications/{{publicationId}}/posts
POST https://api.medium.com/v1/images
Documentation - https://docs.forem.com/api/
fetch('https://dev.to/api/articles', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': '<AUTHENTICATION TOKEN HERE>',
},
body: JSON.stringify({
article: {
title: 'Hello, World!',
published: true,
content: '# You can put Markdown here.\n***\n',
tags: ['discuss', 'help'],
series: 'Hello series',
},
}),
})
.then(res => res.json())
.then(res => console.log(JSON.stringify(res)))
Documentation - https://api.hashnode.com/
GLOBAL
and FOR_ME
FeedType's. Give them a read if you want to understand things a bit better, but keep in mind that a lot of the parameters have been deprecated.![]() |
---|
Generate Hashnode Auth Token |
![]() |
---|
Hashnode's GraphQL Api Playground |
![]() |
---|
Hashnode Documentation Navigation |
fetch('https://api.hashnode.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: '<AUTHENTICATION TOKEN HERE>',
},
body: JSON.stringify({
query:
'mutation createStory($input: CreateStoryInput!){ createStory(input: $input){ code success message } }',
variables: {
input: {
title: 'What are the e2e testing libraries you use ?',
contentMarkdown: '# You can put Markdown here.\n***\n',
tags: [
{
_id: '56744723958ef13879b9549b',
slug: 'testing',
name: 'Testing',
},
],
coverImageURL:
'https://codybontecou.com/images/header-meta-component.png',
},
},
}),
})
.then(res => res.json())
.then(res => console.log(JSON.stringify(res)))
.md
file to the requests content
and contentMarkdown
parameters, editing posts, and many other things. We