Lesson 35: [Coming Soon] Integration and APIs

Build REST APIs, integrate with external services, and implement message queues for extending your chat server with third-party systems

Edit on GitHub

Integration and APIs

Coming Soon

This lesson will teach you how to build REST APIs and integrate your chat server with external services and systems. You’ll learn how to:

  • Build RESTful APIs for chat server operations
  • Integrate with external authentication providers
  • Implement message queues for asynchronous processing
  • Connect to external services (email, push notifications)
  • Build webhook systems for real-time integrations

What You’ll Build

By the end of this lesson, you’ll have implemented:

  • Complete REST API with proper HTTP semantics
  • OAuth2 integration with external providers
  • Message queue system for background processing
  • Email and push notification integrations
  • Webhook system for external service notifications

Key Concepts Preview

% REST API endpoint
handle_request("POST", "/api/rooms", Headers, Body, Req) ->
case authenticate_request(Headers) of
{ok, UserId} ->
{ok, RoomData} = json:decode(Body),
case chat_room_manager:create_room(UserId, RoomData) of
{ok, Room} ->
{201, #{"Content-Type" => "application/json"},
json:encode(Room), Req};
{error, Reason} ->
{400, #{}, json:encode(#{error => Reason}), Req}
end;
{error, unauthorized} ->
{401, #{}, <<"Unauthorized">>, Req}
end.
% Message queue integration
publish_notification(UserId, Message) ->
amqp_channel:cast(get_channel(),
#'basic.publish'{exchange = <<"notifications">>},
#amqp_msg{payload = json:encode(#{user_id => UserId,
message => Message})}).

This lesson builds on the advanced OTP patterns from Lesson 33 and prepares you for the final project review in Lesson 35.


This lesson is currently under development. Check back soon for the complete content!

Finished this lesson?

Mark it as complete to track your progress

This open source tutorial is brought to you by Pennypack Software - we build reliable software systems.

Found an issue? Edit this page on GitHub or open an issue