### Running Documentation Locally - Bash Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/README.md This snippet provides the command to start the local development server for the documentation using Yarn or npm, allowing live preview of changes as you work on the documentation. ```Bash yarn docs:dev # OR npm run docs:dev ``` -------------------------------- ### Installing Vuepress - Bash Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/README.md This snippet shows how to install Vuepress, either globally or as a local development dependency, using Yarn or npm. Vuepress is the static site generator used for this documentation. ```Bash # install globally yarn global add vuepress # OR npm install -g vuepress # install as a local dependency yarn add -D vuepress # OR npm install -D vuepress ``` -------------------------------- ### Retrieving API User Details - Sandbox Request Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/docs/api-description/README.md This snippet shows how to send a GET request to retrieve details for a specific API user in the Sandbox environment. The API user ID is included in the URL path, and the `Ocp-Apim-Subscription-Key` is required in the header for authentication. ```HTTP GET {baseURL}/apiuser/ c72025f5-5cd1-4630-99e4-8ba4722fad56 Host: momodeveloper.mtn.com Ocp-Apim-Subscription-Key: d484a1f0d34f4301916d0f2c9e9106a2 ``` -------------------------------- ### Cloning the Repository - Bash Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/README.md This snippet provides commands to clone the MTN MoMo API documentation repository from GitHub and navigate into the cloned directory, which is the first step to running the documentation locally. ```Bash git clone https://github.com/sparkplug/mtn-momo-api-documentation.git cd mtn-momo-api-documentation ``` -------------------------------- ### Generating Static Assets - Bash Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/README.md This snippet shows the command to build static HTML, CSS, and JavaScript assets for the documentation. These generated files can then be deployed to a web server for production use. ```Bash yarn docs:build # Or npm run docs:build ``` -------------------------------- ### Creating API User - Sandbox Request Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/docs/api-description/README.md This snippet demonstrates how to send a POST request to create a new API user in the Sandbox environment. It requires a `X-Reference-Id` in the header, which will be used as the User ID, and an `Ocp-Apim-Subscription-Key` for authentication. The request body specifies the `providerCallbackHost`. ```HTTP POST {baseURL}/apiuser HTTP/1.1 Host: momodeveloper.mtn.com X-Reference-Id: c72025f5-5cd1-4630-99e4-8ba4722fad56 Ocp-Apim-Subscription-Key: d484a1f0d34f4301916d0f2c9e9106a2 {"providerCallbackHost": "clinic.com"} ``` -------------------------------- ### Creating API User - Sandbox Response Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/docs/api-description/README.md This snippet shows the expected successful response after creating an API user in the Sandbox environment. A `201 Created` status indicates the user has been successfully provisioned. ```HTTP 201 Created ``` -------------------------------- ### Creating API Key - Sandbox Response Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/docs/api-description/README.md This snippet displays the successful response after creating an API key in the Sandbox environment. A `201 Created` status is returned, and the response body contains the newly generated `apiKey`. ```HTTP HTTP/1.1 201 Created date: Wed, 10 Oct 2018 09:16:15 GMT content-type: application/json;charset=utf-8 content-length: 45 { "apiKey": "f1db798c98df4bcf83b538175893bbf0" } ``` -------------------------------- ### Creating API Key - Sandbox Request Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/docs/api-description/README.md This snippet illustrates how to send a POST request to create an API key for a specific API user in the Sandbox environment. The API user ID is specified in the URL path, and the `Ocp-Apim-Subscription-Key` is required in the header for authentication. ```HTTP POST {baseURL}/apiuser/c72025f5-5cd1-4630-99e4-8ba4722fad56/apikey HTTP/1.1 Host: momodeveloper.mtn.com Ocp-Apim-Subscription-Key: d484a1f0d34f4301916d0f2c9e9106a2 ``` -------------------------------- ### Retrieving API User Details - Sandbox Response Source: https://github.com/sparkplug/mtn-momo-api-documentation/blob/master/docs/api-description/README.md This snippet displays the successful response when retrieving API user details in the Sandbox environment. A `200 Accepted` status is returned, and the response body contains details such as `providerCallbackHost` and `targetEnvironment`. ```HTTP HTTP/1.1 200 Accepted date: Wed, 10 Oct 2018 09:16:15 GMT { "providerCallbackHost": "clinic.com", "targetEnvironment": "sandbox" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.