Difference between revisions of "ActivityPub Code"

From Organic Design wiki
m (User Discovery)
m (User Discovery)
Line 14: Line 14:
 
This should return an object describing the user on the server, you should look for inside the links property for an object that has the property '''"type": "application/activity+json"''', the next command should be made to the '''href''' property of that object.
 
This should return an object describing the user on the server, you should look for inside the links property for an object that has the property '''"type": "application/activity+json"''', the next command should be made to the '''href''' property of that object.
 
<source>
 
<source>
curl https://mastodon.online/users/testing_bridge \
+
curl <HREF PROPERTY> \
 
-X GET \
 
-X GET \
 
-H "Accept: application/activity+json"
 
-H "Accept: application/activity+json"

Revision as of 22:20, 7 October 2021

https://www.w3.org/TR/activitypub

Client/Server

The specification doesn't seem to provide endpoints for interacting with an AP server, that is why I believe that most servers use WebFinger. The only issue is that I can't find that in the specification either.

User Discovery

To request the user's endpoint from the server run the following command.

curl <URL>/.well-known/webfinger?resource=<ACCOUNT NAME>@<URL> \
	-X GET \
	-H "Accept: application/json"

This should return an object describing the user on the server, you should look for inside the links property for an object that has the property "type": "application/activity+json", the next command should be made to the href property of that object.

curl <HREF PROPERTY> \
	-X GET \
	-H "Accept: application/activity+json"

That command should return an object describing the relevant endpoints for that user.