VK, or formerly known as Vkontakte, is a popular Russian-based social networking website that offers an expansive set of web APIs for developers. Using the VK API, developers can create a number of applications and services that can interact with VK users and resources. With the VK APIs, developers can create a variety of services ranging from traditional social networking features to more complex applications and games.
Here are some of the things that can be built with the VK API:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
vk: {
type: "app",
app: "vk",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.vk.com/method/users.get`,
headers: {
Authorization: `Bearer ${this.vk.$auth.oauth_access_token}`,
},
params: {
"v": `5.131`,
},
})
},
})
vk uses OAuth authentication. When you connect your vk account, Pipedream will open a popup window where you can sign into vk and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any vk API.
Pipedream requests the following authorization scopes when you connect your account:
134217728
GET
https://oauth.vk.com/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
display=popup
POST
https://oauth.vk.com/access_token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}