Fediverse and Bluesky
Bluesky
atproto-service
Finding and following people on Bluesky, and a person's own Bluesky account connected, which what they do here is written as. Optional: an installation may not run it (federation.md, Bluesky).
Find somebody on Bluesky
/atproto/lookupThey are kept here, so that they can be followed as anybody is. Thirty lookups in ten minutes.
Who: Somebody signed in
Parameters
qstringin queryWhat was typed: a handle with or without its @ (alice.bsky.social), a DID, or the address of their profile page.
Answers
- 200OKatproto.RemotePerson application/json
- 400
lookup_unreadable: not something that names an accountRefusal application/json - 401no token, or one that has expired
- 404
lookup_not_found, there is nobody by that name;lookup_is_here, it is somebody of this installation;lookup_refused, Bluesky or their name is refused hereRefusal application/json - 429
too_many_lookupsRefusal application/json - 502
lookup_failed: Bluesky could not be askedRefusal application/json
Request
curl "https://api.example.org/atproto/lookup" \
-H "Authorization: Bearer $TOKEN"
const response = await fetch('https://api.example.org/atproto/lookup', {
method: 'GET',
headers: { Authorization: `Bearer ${token}` },
});
const answer = await response.json();
import requests
response = requests.get(
"https://api.example.org/atproto/lookup",
headers={"Authorization": f"Bearer {token}"},
)
answer = response.json()
Answer · 200
{
"alias": "string",
"body": "string",
"id": 42,
"locked": false,
"name": "string",
"origin_domain": "string",
"type": "string",
"uri": "https://example.org/",
"url": "https://example.org/"
}
Copy a post's pictures here again
/atproto/posts/{id}/picturesThe pictures of a post from Bluesky that has been left alone a while are removed from storage, and the post says so (media_removed). Asked here, they are read again from Bluesky and copied as they were. For anybody signed in who may see the post.
Who: Somebody signed in
Parameters
idintegerrequiredin pathThe post's id here.
Answers
- 200OKPicturesRestored application/json
- 400the request is not well formed, or a value in it is not one it may be
- 401no token, or one that has expired
- 404
media_not_removed: there is no such post the viewer may see, or its pictures are hereRefusal application/json - 410
media_gone: they are not on Bluesky any moreRefusal application/json - 429
too_many_requestsRefusal application/json - 502
media_failed: Bluesky could not be askedRefusal application/json
Request
curl -X POST "https://api.example.org/atproto/posts/<id>/pictures" \
-H "Authorization: Bearer $TOKEN"
const response = await fetch('https://api.example.org/atproto/posts/<id>/pictures', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
});
const answer = await response.json();
import requests
response = requests.post(
"https://api.example.org/atproto/posts/<id>/pictures",
headers={"Authorization": f"Bearer {token}"},
)
answer = response.json()
Answer · 200
{
"restored": 1
}
The viewer's Bluesky account
/atproto/settingsOr a website's, with profile_id, for one of its administrators.
Who: Somebody signed in
Parameters
profile_idintegerin queryA website the viewer is an administrator of. Left out, the viewer.
Answers
- 200OKatproto.Settings application/json
- 400the request is not well formed, or a value in it is not one it may be
- 401no token, or one that has expired
- 403
bluesky_not_yours: profile_id is not a website the viewer is an administrator ofRefusal application/json - 404
bluesky_writing_off: this installation does not write to Bluesky;bluesky_not_yours, there is no such websiteRefusal application/json
Request
curl "https://api.example.org/atproto/settings" \
-H "Authorization: Bearer $TOKEN"
const response = await fetch('https://api.example.org/atproto/settings', {
method: 'GET',
headers: { Authorization: `Bearer ${token}` },
});
const answer = await response.json();
import requests
response = requests.get(
"https://api.example.org/atproto/settings",
headers={"Authorization": f"Bearer {token}"},
)
answer = response.json()
Answer · 200
{
"broken": false,
"connected": false,
"did": "string",
"handle": "string"
}
Connect the viewer's Bluesky account
/atproto/settingsWith an app password, which is exchanged for a token and not kept. Ten tries in ten minutes. With profile_id, a website's account, for one of its administrators: its notes then go to Bluesky as that account, and what the account posts there itself is not made a post of the website.
Who: Somebody signed in
Body application/json
app_passwordstringAn app password made in Bluesky's settings, never the account's own password. Not kept: it is exchanged for a token, kept encrypted.handlestringThe Bluesky handle: alice.bsky.social.
Answers
- 200OKatproto.Settings application/json
- 400
bluesky_unreadableRefusal application/json - 401no token, or one that has expired
- 403
bluesky_denied: the password is not takenRefusal application/json - 404
bluesky_writing_off: this installation does not write to Bluesky;bluesky_not_found, there is no such account;lookup_refused, Bluesky is refused hereRefusal application/json - 409
bluesky_taken: somebody else here connected that accountRefusal application/json - 429
too_many_triesRefusal application/json - 502
bluesky_failedRefusal application/json
Request
curl -X PUT "https://api.example.org/atproto/settings" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"app_password": "string",
"handle": "string"
}'
const response = await fetch('https://api.example.org/atproto/settings', {
method: 'PUT',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"app_password": "string",
"handle": "string"
}),
});
const answer = await response.json();
import requests
response = requests.put(
"https://api.example.org/atproto/settings",
headers={"Authorization": f"Bearer {token}"},
json={
"app_password": "string",
"handle": "string"
},
)
answer = response.json()
Answer · 200
{
"broken": false,
"connected": false,
"did": "string",
"handle": "string"
}
Disconnect it
/atproto/settingsThe token is forgotten. What was written stays on Bluesky. With profile_id, a website's.
Who: Somebody signed in
Parameters
profile_idintegerin queryA website the viewer is an administrator of. Left out, the viewer.
Answers
- 200OKatproto.Settings application/json
- 400the request is not well formed, or a value in it is not one it may be
- 401no token, or one that has expired
- 404
bluesky_writing_off: this installation does not write to BlueskyRefusal application/json
Request
curl -X DELETE "https://api.example.org/atproto/settings" \
-H "Authorization: Bearer $TOKEN"
const response = await fetch('https://api.example.org/atproto/settings', {
method: 'DELETE',
headers: { Authorization: `Bearer ${token}` },
});
const answer = await response.json();
import requests
response = requests.delete(
"https://api.example.org/atproto/settings",
headers={"Authorization": f"Bearer {token}"},
)
answer = response.json()
Answer · 200
{
"broken": false,
"connected": false,
"did": "string",
"handle": "string"
}
What following here whoever the viewer follows on Bluesky would do
/atproto/settings/import-followsWho: Somebody signed in
Answers
- 200OKatproto.ImportPreview application/json
- 401no token, or one that has expired
- 404
bluesky_writing_off: this installation does not write to BlueskyRefusal application/json - 409
bluesky_not_connectedRefusal application/json - 502
bluesky_failedRefusal application/json
Request
curl "https://api.example.org/atproto/settings/import-follows" \
-H "Authorization: Bearer $TOKEN"
const response = await fetch('https://api.example.org/atproto/settings/import-follows', {
method: 'GET',
headers: { Authorization: `Bearer ${token}` },
});
const answer = await response.json();
import requests
response = requests.get(
"https://api.example.org/atproto/settings/import-follows",
headers={"Authorization": f"Bearer {token}"},
)
answer = response.json()
Answer · 200
{
"following": 1,
"most": 1,
"posts_of_each": 1
}
Follow here whoever the viewer follows on Bluesky
/atproto/settings/import-followsThe ones followed most lately first, leaving out whoever is refused or blocked. Answered at once and carried on with afterwards. Nothing is written to Bluesky. Three times an hour.
Who: Somebody signed in
Body application/json
limitintegerHow many accounts to follow here, beginning with the ones followed most lately.
Answers
- 202Acceptedatproto.ImportStarted application/json
- 400the request is not well formed, or a value in it is not one it may be
- 401no token, or one that has expired
- 404
bluesky_writing_off: this installation does not write to BlueskyRefusal application/json - 409
bluesky_not_connectedRefusal application/json - 429
too_many_triesRefusal application/json - 502
bluesky_failedRefusal application/json
Request
curl -X POST "https://api.example.org/atproto/settings/import-follows" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"limit": 1
}'
const response = await fetch('https://api.example.org/atproto/settings/import-follows', {
method: 'POST',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"limit": 1
}),
});
const answer = await response.json();
import requests
response = requests.post(
"https://api.example.org/atproto/settings/import-follows",
headers={"Authorization": f"Bearer {token}"},
json={
"limit": 1
},
)
answer = response.json()
Answer · 202
{
"limit": 1,
"started": false
}
Written by Claude, reviewed by Rastin Mehr · About this