API Reference

Build custom experiences for your customers with a Pharmacy platform designed for your business.

1Pick a language

2Try it!

Click Try It! to start a request and see the response here!

Introduction

🚧

Before you begin!

You should create a free Famasi account to test the API. We'll provide you with test keys for making API calls, so you're in good hands.

Famasi Africa's API is designed to follow RESTful principles and is organised to cater to the primary resources you'd be dealing with. There are a few exceptions but hey, don't sweat the small stuff. With our API, you'll breeze through the resources while accessing the data you need with ease.

Authentication

If you want to authenticate and make unique API calls, make sure you include your key in the authorisation header of the request!

You can easily manage your API keys right from your dashboard, so you don't have to worry about losing them.

Authorisation headers should be in the following format:

X-TOKEN: <JWT token>
X-TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJJZCI6IjBmN2NiMjMzLWFlNDEtNDY1NS1hZGJiLThkYWIwNDQ2MzM4ZCIsImVtYWlsIjoiZW5naW5lZXJpbmdAZmFtYXNpLmFmcmljYSJ9LCJpYXQiOjE2ODUwNDc2MTksImV4cCI6MTY4NTA1MTIxOX0.jn4iwW7aUuuYCn059jwbSnEedU8AYgsl3pKbcQQ7nDM

📘

All API requests must be made over HTTPS and API requests made without authentication will fail with the status code 401: Unauthorised.

HTTP Methods

MethodsDescriptions
POSTA POST request is used to submit data to a server, typically to create a new resource or update an existing one. The data is sent in the request body and the server responds with the requested data in JSON.

For example, POST Medications is used to create a new user's medication.
GETA GET request is used to retrieve data or information from a server. It is performed by sending a request to a specific URL, and the server responds with the requested data in JSON.

For example, GET Medications fetches a list of user medications
PATCHA PATCH request is used to partially update an existing resource on the server. It sends data in the request body containing only the changes that need to be applied to the resource, allowing for specific modifications without affecting the entire resource.

For example, PATCH Medications is used to update an existing medication with a matching ID.
DELETEA DELETE request is used to remove or delete a specific resource on the server. It targets a specific URL and instructs the server to delete the corresponding resource, permanently removing it from the system.

For example, DELETE Medication is used to delete an existing medication with a matching ID.

Sample Requests

We provide sample API calls next to each method using your preferred programming language. All you need to do is insert your specific parameters and you can test the calls.

Requests and Responses

Both request body data and response data are formatted as JSON. Content type for responses will always be application/json.

Therefore, all responses will be in the following format:

{
    "statusCode": 200,
    "responseMessage": "User profile fetched successfuly.",
    "data": {
        "user": {
            "id": 32,
            "uuid": "b07cdf52-14b1-493e-9ef5-f943d7119ef2",
            "fullName": "Ivan Diaz",
            "email": "[email protected]",
            "gender": null,
            "dob": null,
            "phoneNumber": "+2347012228661",
            "hasAllergies": null,
            "address": null,
            "isAdmin": false,
            "isVerified": false,
            "state": null,
            "patientId": "PX-47XW1UYZSD",
            "type": "patient",
            "pneumaCareId": null,
            "createdAt": "2023-05-20T15:39:49.972Z",
            "updatedAt": "2023-05-20T15:39:53.225Z",
            "dependants": []
        }
    },
    "success": true,
    "requestStatus": "success"
}

And this is a sample of the error response you'll get upon a failed authentication:

{
    "statusCode": 401,
    "errorMessage": "Token is not provided",
    "success": false,
    "errorCode": "ERR-UNAUTH-401",
    "requestStatus": "failed"
}
Popular Endpoints
Last 24 Hours
LoadingLoading…