Arkipel API Connection

All requests to the /arkipel/{community_public_key}/streams endpoint must adhere to the following requirements:

1. Endpoint Structure

  • URL Format: https://{site_url}/arkipel/{community_public_key}/streams Replace {site_url} with the base URL of the Arkipel server and {community_public_key} with the server’s public key.

2. HTTP Configuration

  • Method: POST
  • Headers:
    • Content-Type: application/json
    • Accept: application/json
  • Standard Timeout Defaults:
    • Open Timeout: 5 seconds (connection establishment)
    • Read Timeout: 10 seconds (response waiting)
  • SSL/TLS:
    • SSL verification is disabled in the example (VERIFY_NONE). In production, always enable SSL verification (VERIFY_PEER) for security.

3. Request Body

  • The request body must be a valid JSON object matching the schema of the message type you are sending (e.g., people:upsert, arkipel_messages:query).

4. Example Setup (Ruby)

request_body = { ... }
uri = URI.parse("#{site_url}/arkipel/#{community_public_key}/streams")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = site_url.start_with?("https")
http.open_timeout = 5      # Connection timeout
http.read_timeout = 10     # Response timeout
http.verify_mode = OpenSSL::SSL::VERIFY_PEER  # Enable in production!
request = Net::HTTP::Post.new(uri.request_uri,
  "Content-Type" => "application/json",
  "Accept" => "application/json"
)
request.body = request_body.to_json

5. Security Note

  • SSL Verification: The example disables SSL verification (VERIFY_NONE) for simplicity. In production, always set verify_mode = OpenSSL::SSL::VERIFY_PEER to ensure secure communication.
  • Authentication: Ensure the community_public_key is valid and authorized for the target community.

6. Why These Constraints?

  • Timeouts: Prevent hanging connections and improve reliability.
  • SSL: Protects data integrity and confidentiality (enable verification in production).
  • JSON: Ensures consistent data formatting for all message types.