following
Creates, updates, deletes, gets or lists a following resource.
Overview
| Name | following |
| Type | Resource |
| Id | github.users.following |
Fields
The following fields are returned by SELECT queries:
- list_following_for_user
- list_followed_by_authenticated_user
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | |
gravatar_id | string | (example: 41d064eb2195891e12d0413f63227ea7) |
node_id | string | (example: MDQ6VXNlcjE=) |
avatar_url | string (uri) | (example: https://github.com/images/error/octocat_happy.gif) |
email | string | |
events_url | string | (example: https://api.github.com/users/octocat/events{/privacy}) |
followers_url | string (uri) | (example: https://api.github.com/users/octocat/followers) |
following_url | string | (example: https://api.github.com/users/octocat/following{/other_user}) |
gists_url | string | (example: https://api.github.com/users/octocat/gists{/gist_id}) |
html_url | string (uri) | (example: https://github.com/octocat) |
login | string | (example: octocat) |
organizations_url | string (uri) | (example: https://api.github.com/users/octocat/orgs) |
received_events_url | string (uri) | (example: https://api.github.com/users/octocat/received_events) |
repos_url | string (uri) | (example: https://api.github.com/users/octocat/repos) |
site_admin | boolean | |
starred_at | string | (example: "2020-07-09T00:17:55Z") |
starred_url | string | (example: https://api.github.com/users/octocat/starred{/owner}{/repo}) |
subscriptions_url | string (uri) | (example: https://api.github.com/users/octocat/subscriptions) |
type | string | (example: User) |
url | string (uri) | (example: https://api.github.com/users/octocat) |
user_view_type | string | (example: public) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | |
gravatar_id | string | (example: 41d064eb2195891e12d0413f63227ea7) |
node_id | string | (example: MDQ6VXNlcjE=) |
avatar_url | string (uri) | (example: https://github.com/images/error/octocat_happy.gif) |
email | string | |
events_url | string | (example: https://api.github.com/users/octocat/events{/privacy}) |
followers_url | string (uri) | (example: https://api.github.com/users/octocat/followers) |
following_url | string | (example: https://api.github.com/users/octocat/following{/other_user}) |
gists_url | string | (example: https://api.github.com/users/octocat/gists{/gist_id}) |
html_url | string (uri) | (example: https://github.com/octocat) |
login | string | (example: octocat) |
organizations_url | string (uri) | (example: https://api.github.com/users/octocat/orgs) |
received_events_url | string (uri) | (example: https://api.github.com/users/octocat/received_events) |
repos_url | string (uri) | (example: https://api.github.com/users/octocat/repos) |
site_admin | boolean | |
starred_at | string | (example: "2020-07-09T00:17:55Z") |
starred_url | string | (example: https://api.github.com/users/octocat/starred{/owner}{/repo}) |
subscriptions_url | string (uri) | (example: https://api.github.com/users/octocat/subscriptions) |
type | string | (example: User) |
url | string (uri) | (example: https://api.github.com/users/octocat) |
user_view_type | string | (example: public) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_following_for_user | select | username | per_page, page | Lists the people who the specified user follows. |
list_followed_by_authenticated_user | select | per_page, page | Lists the people who the authenticated user follows. | |
check_person_is_followed_by_authenticated | exec | username | ||
follow | exec | username | Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."OAuth app tokens and personal access tokens (classic) need the user:follow scope to use this endpoint. | |
unfollow | exec | username | OAuth app tokens and personal access tokens (classic) need the user:follow scope to use this endpoint. | |
check_following_for_user | exec | username, target_user |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
target_user | string | |
username | string | The handle for the GitHub user account. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_following_for_user
- list_followed_by_authenticated_user
Lists the people who the specified user follows.
SELECT
id,
name,
gravatar_id,
node_id,
avatar_url,
email,
events_url,
followers_url,
following_url,
gists_url,
html_url,
login,
organizations_url,
received_events_url,
repos_url,
site_admin,
starred_at,
starred_url,
subscriptions_url,
type,
url,
user_view_type
FROM github.users.following
WHERE username = '{{ username }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
Lists the people who the authenticated user follows.
SELECT
id,
name,
gravatar_id,
node_id,
avatar_url,
email,
events_url,
followers_url,
following_url,
gists_url,
html_url,
login,
organizations_url,
received_events_url,
repos_url,
site_admin,
starred_at,
starred_url,
subscriptions_url,
type,
url,
user_view_type
FROM github.users.following
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
Lifecycle Methods
- check_person_is_followed_by_authenticated
- follow
- unfollow
- check_following_for_user
if the person is followed by the authenticated user
EXEC github.users.following.check_person_is_followed_by_authenticated
@username='{{ username }}' --required
;
Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."
OAuth app tokens and personal access tokens (classic) need the user:follow scope to use this endpoint.
EXEC github.users.following.follow
@username='{{ username }}' --required
;
OAuth app tokens and personal access tokens (classic) need the user:follow scope to use this endpoint.
EXEC github.users.following.unfollow
@username='{{ username }}' --required
;
if the user follows the target user
EXEC github.users.following.check_following_for_user
@username='{{ username }}' --required,
@target_user='{{ target_user }}' --required
;