How the SDK layers work: API vs Client
masterThe SDK provides two distinct layers of interaction:
- API Layer (
matrix_client.api): A low-level layer that wraps raw HTTP API calls. It has minimal business logic. You can provide an accesstokenfor requests and a customtxn_id(transaction ID) which the SDK will increment for each request. - Client Layer (
matrix_client.client): A high-level layer that wraps the API layer. It provides a rich object model (such asRoomobjects) to perform actions more easily.
Choose the API layer if you need direct access to raw HTTP calls, and the Client layer if you want to work with high-level abstractions and object models.