-
Notifications
You must be signed in to change notification settings - Fork 3
Go to your user Settings page on your pod. At the bottom will be a link to generate an API key. Click it to generate the key. You can regenerate the key any time.
All API endpoints accept and return only JSON, and are at /fapi/v0. For example, the /foobar endpoint on diasp0ra.ca would be at https://diasp0ra.ca/fapi/v0/foobar.json. Your API key is required as a parameter on every request. It can be provided in the GET parameters (e.g. /fapi/v0/some-endpoint.json?token=abcdef1234567890), or in the POST data.
Why fapi? F stands for fun, F stands for fake. I'm just putting this out there for us to play with until some experts make a real API, with OAuth, high security, standards support, and impressive-sounding things like that.
curl -d "text=test post sent at $(date)" 'https://diasp0ra.ca/fapi/v0/posts.json?token=6b2af2347ce324e822a396c77c72c215' -v
curl 'https://diasp0ra.ca/fapi/v0/posts.json?token=6b2af2347ce324e822a396c77c72c215' -d 'text=yo' -d 'aspect_ids[]=14' -d 'aspect_ids[]=13'
% gem install rest-client
% restclient 'https://diasp0ra.ca/fapi/v0'
ree-1.8.7-2011.03 :001 > post '/posts.json', 'token' => '6b2af2347ce324e822a396c77c72c215', 'text' => "#test post\n\nSent at #{DateTime.now}"
# gem install rest-client
require 'rest_client'
RestClient.post 'https://diasp0ra.ca/fapi/v0/posts.json', 'token' => '398959b90097bf61e33f064592cf27bc', 'text' => 'Test post.'
Returns your aspects.
Returns your contacts, with embedded person objects.
Returns up to 32 of your most recent unread notifications.
Posts a public message authored by you.
Parameters:
- text: The text of the post. May include newlines, and Markdown.
- aspect_ids (optional): An array of aspect ID numbers (integers). If omitted, the post will be public.
- Requests are throttled: Requests cannot be made faster than once every 5 seconds.