API Documentation: Parcel Management

Find Your Token

To authenticate your API requests, you'll need a valid Bearer token. Here's how you can find it:

1. Log in to your account on the platform. : https://admin.elog.ma/login

2. Navigate to the Api documentation page. : https://admin.elog.ma/livreur-api

3. Look for the section labeled "API Token" or "Authentication."

4. Copy the token provided in that section.

Below is a screenshot that highlights where to find the token:

Screenshot showing where to find the API token

Change Parcel Status

This API allows authorized users to change the status of a parcel. It is a POST request that requires a valid Bearer token and expects data in JSON format.

Endpoint

URL: https://livreur-api.elog.ma/change-status
Method: POST

Headers

Request Body

Required Parameters:

Optional Parameters:

Example Request

{
    "parcel_code": "KDS082457334PG",
    "status_code": "CANCELED",
    "status_comment": "Client canceled the order",
    "status_date": ""
}

Response

Success Response:

Example Success Response:

{
    "status": "success",
    "code": 200,
    "message": "le statut a changé avec succès",
    "data": null,
    "errors": null
}

Error Responses:

Example Error Response:

{
    "status": "error",
    "code": 400,
    "message": "Colis non trouvé",
    "data": null,
    "errors": null
}

Fetch Parcel Status

This API allows authorized users to fetch the current status of a parcel. It is a POST request that requires a valid Bearer token.

Endpoint

URL: https://livreur-api.elog.ma/fetch-status
Method: POST

Headers

Example Request

https://livreur-api.elog.ma/fetch-status

Response

Success Response:

Example Success Response:

{
                "status": "success",
                "code": 200,
                "message": "Statuts récupérés avec succès.",
                "data": {
                    "status": [
                        {
                            "statut_code": "DELIVERED",
                            "statut_name": "Livré",
                            "status_require_comment": false,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "POSTPONED",
                            "statut_name": "Reporté",
                            "status_require_comment": false,
                            "status_require_date": true
                        },
                        {
                            "statut_code": "NOANSWER",
                            "statut_name": "Pas de réponse + SMS",
                            "status_require_comment": false,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "UNREACHABLE",
                            "statut_name": "Injoignable",
                            "status_require_comment": false,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "OUT_OF_AREA",
                            "statut_name": "Hors-zone",
                            "status_require_comment": true,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "CANCELED",
                            "statut_name": "Annulé",
                            "status_require_comment": true,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "REFUSE",
                            "statut_name": "Refusé",
                            "status_require_comment": true,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "ERR",
                            "statut_name": "Numero_Erroné ",
                            "status_require_comment": false,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "DEUX",
                            "statut_name": "Deuxième Appel Pas Réponse",
                            "status_require_comment": false,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "TROIS",
                            "statut_name": "Troisième Appel Pas Réponse",
                            "status_require_comment": false,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "PROGRAMMER",
                            "statut_name": "Programmé",
                            "status_require_comment": false,
                            "status_require_date": true
                        },
                        {
                            "statut_code": "EN_VOYAGE",
                            "statut_name": "En Voyage",
                            "status_require_comment": false,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "WAIT_RELANCE",
                            "statut_name": "Attende de relancer",
                            "status_require_comment": false,
                            "status_require_date": false
                        },
                        {
                            "statut_code": "BV",
                            "statut_name": "Boite Vocal",
                            "status_require_comment": false,
                            "status_require_date": false
                        }
                    ]
                },
                "errors": null
            }

Error Responses:

Example Error Response:

{
    "status": "error",
    "code": 403,
    "message": "Unauthorized Access",
    "data": null,
    "errors": null
}