dev.to
Module dev.to
API
Definitions
ballerinax/dev.to Ballerina library
Overview
This is a generated connector for DEV API v0.9.7 OpenAPI specification.
This API provides a access to forem articles, users and other resources. For a real-world example of Forem in action, check out DEV. All endpoints that don't require authentication are CORS enabled.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create DEV.to Account
- Obtaining tokens by following this link and in the "DEV API Keys" section create a new key by adding a description and clicking on "Generate API Key".
Clients
dev.to: Client
This is a generated connector for DEV API v0.9.7 OpenAPI specification. Access Forem articles, users and other resources via API. For a real-world example of Forem in action, check out DEV. All endpoints that don't require authentication are CORS enabled. Dates and date times, unless otherwise specified, must be inthe RFC 3339 format.
Constructor
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create an DEVto Account and obtain tokens by log into DEV Account.
init (ApiKeysConfig apiKeyConfig, ConnectionConfig config, string serviceUrl)
- apiKeyConfig ApiKeysConfig - API keys for authorization
- config ConnectionConfig {} - The configurations to be used when initializing the
connector
- serviceUrl string "https://dev.to/api" - URL of the target service
getArticles
function getArticles(int page, int perPage, string? tag, string? tags, string? tagsExclude, string? username, string? state, int? top, int? collectionId) returns ArticleIndex[]|error
Published articles
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
- tag string? (default ()) - Using this parameter will retrieve articles that contain the requested tag. Articles will be ordered by descending popularity. This parameter can be used in conjuction with
top
.
- tags string? (default ()) - Using this parameter will retrieve articles with any of the comma-separated tags. Articles will be ordered by descending popularity.
- tagsExclude string? (default ()) - Using this parameter will retrieve articles that do not contain any of comma-separated tags. Articles will be ordered by descending popularity.
- username string? (default ()) - Using this parameter will retrieve articles belonging to a User or Organization ordered by descending publication date. If
state=all
the number of items returned will be1000
instead of the default30
. This parameter can be used in conjuction withstate
.
- state string? (default ()) - Using this parameter will allow the client to check which articles are fresh or rising. If
state=fresh
the server will return fresh articles. Ifstate=rising
the server will return rising articles. This param can be used in conjuction withusername
, only if set toall
.
- top int? (default ()) - Using this parameter will allow the client to return the most popular articles in the last
N
days.top
indicates the number of days since publication of the articles returned. This param can be used in conjuction withtag
.
- collectionId int? (default ()) - Adding this will allow the client to return the list of articles belonging to the requested collection, ordered by ascending publication date.
Return Type
- ArticleIndex[]|error - A list of articles
createArticle
function createArticle(ArticleCreate payload) returns ArticleShow|error
Create a new article
Parameters
- payload ArticleCreate - Article to create
Return Type
- ArticleShow|error - A newly created article
getLatestArticles
function getLatestArticles(int page, int perPage) returns ArticleIndex[]|error
Published articles sorted by publish date
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
Return Type
- ArticleIndex[]|error - A list of articles sorted by descending publish date
getUserArticles
User's articles
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
getUserAllArticles
User's all articles
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
getUserPublishedArticles
User's published articles
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
getUserUnpublishedArticles
User's unpublished articles
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
getArticleById
function getArticleById(int id) returns ArticleShow|error
A published article by ID
Parameters
- id int - Id of the article
Return Type
- ArticleShow|error - An article
updateArticle
function updateArticle(int id, ArticleUpdate payload) returns ArticleShow|error
Update an article
Return Type
- ArticleShow|error - The updated article
getArticleByPath
function getArticleByPath(string username, string slug) returns ArticleShow|error
A published article by path
Return Type
- ArticleShow|error - An article
getCommentsByArticleId
Comments
Parameters
- aId int? (default ()) - Article identifier.
- pId int? (default ()) - Podcast Episode identifier.
getCommentById
Comment
Parameters
- id string - Comment identifier.
getFollowers
Followers
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 80) - Page size (the number of items to return per page).
- sort string (default "created_at") - Specifies the sort order for the
created_at
param of the follow relationship. To sort by newest followers first (descending order) specify?sort=-created_at
.
getFollowedTags
function getFollowedTags() returns FollowedTag[]|error
Followed tags
Return Type
- FollowedTag[]|error - A list of followed tags
getListings
Published listings
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
- category string? (default ()) - Using this parameter will return listings belonging to the requested category.
createListing
function createListing(ListingCreate payload) returns Listing|error
Create a new listing
Parameters
- payload ListingCreate - Listing to create
getListingsByCategory
function getListingsByCategory(ListingCategory category, int page, int perPage) returns Listing[]|error
Published listings by category
Parameters
- category ListingCategory - The category of the listing
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
getListingById
A listing
Parameters
- id int - Id of the listing
updateListing
function updateListing(int id, ListingUpdate payload) returns ArticleShow|error
Update a listing
Return Type
- ArticleShow|error - The updated article
getOrganization
function getOrganization(string username) returns Organization|error
An organization
Parameters
- username string - Username of the organization
Return Type
- Organization|error - An organization
getOrgArticles
function getOrgArticles(string username, int page, int perPage) returns ArticleIndex[]|error
Organization's Articles
Parameters
- username string - Username of the organization
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
Return Type
- ArticleIndex[]|error - A list of users belonging to the organization
getOrgListings
function getOrgListings(string username, int page, int perPage, string? category) returns json[]|error
Organization's listings
Parameters
- username string - Username of the organization
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
- category string? (default ()) - Using this parameter will return listings belonging to the requested category.
Return Type
- json[]|error - A list of listings belonging to the organization
getOrgUsers
Organization's users
Parameters
- username string - Username of the organization
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
getPodcastEpisodes
function getPodcastEpisodes(int page, int perPage, string? username) returns PodcastEpisode[]|error
Published podcast episodes
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
- username string? (default ()) - Using this parameter will retrieve episodes belonging to a specific podcast.
Return Type
- PodcastEpisode[]|error - A list of podcast episodes
getProfileImage
function getProfileImage(string username) returns ProfileImage|error
User or organization profile picture
Parameters
- username string - Username of the user or organization
Return Type
- ProfileImage|error - The profile image
getReadinglist
function getReadinglist(int page, int perPage) returns ReadingList[]|error
User's reading list
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 30) - Page size (the number of items to return per page).
Return Type
- ReadingList[]|error - The reading list with a overwiew of the article
getTags
Tags
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 10) - Page size (the number of items to return per page).
getUserMe
The authenticated user
getUser
A user
Parameters
- id string - Id of the user. It can be either of the following two values: - an integer representing the id of the user - the string
by_username
(needs to be used in conjuction with the paramurl
)
- url string? (default ()) - Username of the user
getArticlesWithVideo
function getArticlesWithVideo(int page, int perPage) returns ArticleVideo[]|error
Articles with a video
Parameters
- page int (default 1) - Pagination page.
- perPage int (default 24) - Page size (the number of items to return per page).
Return Type
- ArticleVideo[]|error - A list of video articles
getWebhooks
function getWebhooks() returns WebhookIndex[]|error
Webhooks
Return Type
- WebhookIndex[]|error - A list of webhooks
createWebhook
function createWebhook(WebhookCreate payload) returns WebhookShow|error
Create a new webhook
Parameters
- payload WebhookCreate - Webhook to create
Return Type
- WebhookShow|error - A newly created webhook
getWebhookById
function getWebhookById(int id) returns WebhookShow|error
A webhook endpoint
Parameters
- id int - Id of the webhook
Return Type
- WebhookShow|error - A webhook endpoint
deleteWebhook
A webhook endpoint
Parameters
- id int - Id of the webhook
Records
dev.to: APIError
Fields
- 'error string -
- status int -
dev.to: ApiKeysConfig
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- apiKey string - All requests on this API needs to include an API key. The API key can be provided as part of the query string or as a request header. The name of the API key needs to be
api-key
Authentication for some endpoints, like write operations on the Articles API require a DEV API key.Getting an API key
To obtain one, please follow these steps:- visit https://dev.to/settings/account
- in the "DEV API Keys" section create a new key by adding a description and clicking on "Generate API Key"
- You'll see the newly generated key in the same view
dev.to: ArticleCreate
Fields
- article ArticlecreateArticle? -
dev.to: ArticlecreateArticle
Fields
- body_markdown string? - The body of the article.
It can contain an optional front matter. For example
--- title: Hello, World! published: true tags: discuss, help date: 20190701T10:00Z series: Hello series canonical_url: https://example.com/blog/hello cover_image: article_published_cover_image ---
date
,series
andcanonical_url
are optional.date
is the publication date-timeseries
is the name of the series the article belongs tocanonical_url
is the canonical URL of the articlecover_image
is the main image of the article If the markdown contains a front matter, it will take precedence on the equivalent params given in the payload.
- canonical_url string? -
- description string? -
- main_image string? -
- organization_id int? - Only users belonging to an organization can assign the article to it
- published boolean? - True to create a published article, false otherwise. Defaults to false
- series string? - Article series name. All articles belonging to the same series need to have the same name in this parameter.
- tags string[]? -
- title string? -
dev.to: ArticleFlareTag
Flare tag of the article
Fields
- bg_color_hex string? - Background color (hexadecimal)
- name string? -
- text_color_hex string? - Text color (hexadecimal)
dev.to: ArticleIndex
Fields
- canonical_url string -
- comments_count int -
- cover_image string -
- created_at string -
- crossposted_at string -
- description string -
- edited_at string -
- flare_tag ArticleFlareTag? - Flare tag of the article
- id int -
- last_comment_at string -
- organization SharedOrganization? - The organization the resource belongs to
- path string -
- positive_reactions_count int -
- public_reactions_count int -
- published_at string -
- published_timestamp string - Crossposting or published date time
- readable_publish_date string -
- reading_time_minutes int - Reading time, in minutes
- slug string -
- social_image string -
- tag_list string[] -
- tags string -
- title string -
- type_of string -
- url string -
- user SharedUser - The resource creator
dev.to: ArticleMe
Fields
- body_markdown string - The body of the article in Markdown format
- canonical_url string -
- comments_count int -
- cover_image string -
- description string -
- flare_tag ArticleFlareTag? - Flare tag of the article
- id int -
- organization SharedOrganization? - The organization the resource belongs to
- page_views_count int -
- path string -
- positive_reactions_count int -
- public_reactions_count int -
- published boolean -
- published_at string -
- published_timestamp string - Crossposting or published date time
- reading_time_minutes int - Reading time, in minutes
- slug string -
- tag_list string[] -
- title string -
- type_of string -
- url string -
- user SharedUser - The resource creator
dev.to: ArticleShow
Fields
- body_html string -
- body_markdown string -
- canonical_url string -
- comments_count int -
- cover_image string -
- created_at string -
- crossposted_at string -
- description string -
- edited_at string -
- flare_tag ArticleFlareTag? - Flare tag of the article
- id int -
- last_comment_at string -
- organization SharedOrganization? - The organization the resource belongs to
- path string -
- positive_reactions_count int -
- public_reactions_count int -
- published_at string -
- published_timestamp string - Crossposting or published date time
- readable_publish_date string -
- reading_time_minutes int - Reading time, in minutes
- slug string -
- social_image string -
- tag_list string -
- tags string[] -
- title string -
- type_of string -
- url string -
- user SharedUser - The resource creator
dev.to: ArticleUpdate
Fields
- article ArticleupdateArticle? -
dev.to: ArticleupdateArticle
Fields
- body_markdown string? - The body of the article.
It can contain an optional front matter. For example
--- title: Hello, World! published: true tags: discuss, help date: 20190701T10:00Z series: Hello series canonical_url: https://example.com/blog/hello cover_image: article_published_cover_image ---
date
,series
andcanonical_url
are optional.date
is the publication date-timeseries
is the name of the series the article belongs tocanonical_url
is the canonical URL of the articlecover_image
is the main image of the article If the markdown contains a front matter, it will take precedence on the equivalent params given in the payload.
- canonical_url string? -
- description string? -
- main_image string? -
- organization_id int? - Only users belonging to an organization can assign the article to it
- published boolean? - True to create a published article, false otherwise. Defaults to false
- series string? - Article series name.
All articles belonging to the same series need to have the same name
in this parameter.
To remove an article from a series, the
null
value can be used.
- tags string[]? -
- title string? -
dev.to: ArticleVideo
Fields
- cloudinary_video_url string - The preview image of the video
- id int -
- path string -
- title string -
- type_of string -
- user ArticlevideoUser -
- user_id int -
- video_duration_in_minutes string - The duration of the video.
If the video duration is below 1 hour, the format will be
mm:ss
, if it's 1 hour or above the format will beh:mm:ss
.
- video_source_url string -
dev.to: ArticlevideoUser
Fields
- name string? - The user's name
dev.to: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
dev.to: Comment
Fields
- body_html string - HTML formatted comment
- children Comment[] -
- created_at string -
- id_code string -
- type_of string -
- user SharedUser - The resource creator
dev.to: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
dev.to: FollowedTag
Fields
- id int - Tag id
- name string -
- points float -
dev.to: Follower
Fields
- created_at string - Date the user became a follower
- id int - Follow id
- name string -
- path string -
- profile_image string - Profile image (60x60)
- type_of string -
- username string -
dev.to: Listing
Fields
- body_markdown string -
- category ListingCategory -
- id int -
- organization SharedOrganization? - The organization the resource belongs to
- processed_html string -
- published boolean -
- slug string -
- tag_list string -
- tags string[] -
- title string -
- type_of string -
- user SharedUser - The resource creator
dev.to: ListingCreate
Fields
- listing ListingcreateListing? -
dev.to: ListingcreateListing
Fields
- action string? - Set it to "draft" to create an unpublished listing
- body_markdown string - The body of the listing in Markdown format.
- category ListingCategory -
- contact_via_connect boolean? - True if users are allowed to contact the listing's owner via DEV connect, false otherwise. Defaults to false.
- expires_at string? - Date and time of expiration.
- location string? - Geographical area or city for the listing.
- organization_id int? - The id of the organization the user is creating the listing for. Only users belonging to an organization can assign the listing to it.
- tag_list string? - Comma separated list of tags. A maximum of 8 tags are allowed.
- tags string[]? - Tags related to the listing.
A maximum of 8 tags are allowed and it takes precedence over
tag_list
.
- title string -
dev.to: ListingUpdate
Fields
- listing ListingupdateListing? -
dev.to: ListingupdateListing
Fields
- action string? - This param can be provided by itself to invoke some actions:
bump
bumps the listing and charge either the organization or the userpublish
publishes a draft listingunpublish
unpublishes a published listing
- body_markdown string? - The body of the listing in Markdown format.
- category ListingCategory? -
- contact_via_connect boolean? - True if users are allowed to contact the listing's owner via DEV connect, false otherwise. Defaults to false.
- expires_at string? - Date and time of expiration.
- location string? - Geographical area or city for the listing.
- tag_list string? - Comma separated list of tags. A maximum of 8 tags are allowed.
- tags string[]? - Tags related to the listing.
A maximum of 8 tags are allowed and it takes precedence over
tag_list
.
- title string? -
dev.to: Organization
Organization
Fields
- github_username string? -
- joined_at string? - Date of joining
- location string? -
- name string? -
- profile_image string? - Profile image (640x640)
- story string? -
- summary string? -
- tag_line string? -
- tech_stack string? -
- twitter_username string? -
- type_of string? -
- url string? -
- username string? -
dev.to: PodcastEpisode
Fields
- id int -
- image_url string -
- path string -
- podcast PodcastepisodePodcast -
- title string -
- type_of string -
dev.to: PodcastepisodePodcast
Fields
- image_url string? -
- slug string? -
- title string? -
dev.to: ProfileImage
Profile image
Fields
- image_of string? - Discriminates what is the type of the profile image owner (user or organization)
- profile_image string? - Profile image (640x640)
- profile_image_90 string? - Profile image (90x90)
- type_of string? -
dev.to: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
dev.to: ReadingList
Fields
- article ArticleIndex -
- created_at string -
- id int - Follow id
- status string -
- type_of string -
dev.to: SharedOrganization
The organization the resource belongs to
Fields
- name string? -
- profile_image string? - Profile image (640x640)
- profile_image_90 string? - Profile image (90x90)
- slug string? -
- username string? -
dev.to: SharedUser
The resource creator
Fields
- github_username string? -
- name string? -
- profile_image string? - Profile image (640x640)
- profile_image_90 string? - Profile image (90x90)
- twitter_username string? -
- username string? -
- website_url string? -
dev.to: Tag
Fields
- bg_color_hex string - Background color (hexadecimal)
- id int -
- name string -
- text_color_hex string - Text color (hexadecimal)
dev.to: User
Fields
- github_username string -
- id int -
- joined_at string - Date of joining (formatted with strftime
"%b %e, %Y"
)
- location string -
- name string -
- profile_image string - Profile image (320x320)
- summary string -
- twitter_username string -
- type_of string -
- username string -
- website_url string -
dev.to: WebhookCreate
Webhook creation payload
Fields
- webhook_endpoint WebhookcreateWebhookEndpoint? -
dev.to: WebhookcreateWebhookEndpoint
Fields
- events string[] - An array of events identifiers
- 'source string - The name of the requester, eg. "DEV"
- target_url string -
dev.to: WebhookIndex
Webhook
Fields
- created_at string? -
- events string[]? - An array of events identifiers
- id int? -
- 'source string? - The name of the requester, eg. "DEV"
- target_url string? -
- type_of string? -
dev.to: WebhookShow
Webhook
Fields
- created_at string? -
- events string[]? - An array of events identifiers
- id int? -
- 'source string? - The name of the requester, eg. "DEV"
- target_url string? -
- type_of string? -
- user SharedUser? - The resource creator
String types
dev.to: ListingCategory
ListingCategory
Import
import ballerinax/dev.to;
Metadata
Released date: over 1 year ago
Version: 1.5.1
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Keywords
Marketing/Social Media Accounts
Cost/Freemium
Contributors
Dependencies