AfricasTalkingLtd / africastalking-node.js

Official Node.js SDK for Africa's Talking
https://developers.africastalking.com
MIT License
137 stars 109 forks source link

Request for Contribution Guide #112

Open oxenprogrammer opened 1 year ago

oxenprogrammer commented 1 year ago

Problem

Contributors to the AfricaIsTalking API would benefit from having clear and comprehensive guidelines on how to contribute effectively to the project. Currently, there is no contribution guide available, making it challenging for newcomers to get started and for existing contributors to follow best practices consistently.

Solution

We propose creating a Contribution Guide for the AfricaIsTalking API. This guide will provide step-by-step instructions and best practices for contributing to the project. It should cover topics such as:

Benefits

A well-structured contribution guide will have several advantages:

  1. Onboarding New Contributors: Newcomers will find it easier to understand the project's workflow and coding standards, reducing the barrier to entry.

  2. Consistency: Contributors will follow a consistent process when submitting contributions, making it easier for maintainers to review and merge changes.

  3. Improved Code Quality: By providing guidelines for writing code and running tests, we can ensure that contributions meet the project's quality standards.

  4. Community Growth: A clear contribution guide can attract more contributors, fostering a healthy and active open-source community.

Acceptance Criteria:

Additional Information:

We believe that providing a contribution guide will greatly enhance the development experience for all contributors and help the AfricaIsTalking API project thrive. Your input and contributions to creating this guide are highly appreciated.

Please feel free to discuss and offer suggestions related to this issue. Thank you for your support and dedication to the project!

oxenprogrammer commented 1 year ago

@DaggieBlanqx Is anything going to get done here?

kievo23 commented 10 months ago

### Airtime Am having issues on following the docs vs what the API is giving as feedback. The node js package which am using is also giving me a hard time since am using ES6. I would appreciate if the docs and packages can be updated as some of the dependencies are deprecated.

For someone using ES6. you can use the following code. You will need axios library, very awesome library in my opinion Say you have name the code below as Africastalking.js

`

import axios from "axios";

const AirtimeInstance = async () => {

return axios.create({ baseURL: 'https://api.africastalking.com', headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'apiKey': ${process.env.AfricasTalkingApiKey} }, data : {'username' : 'bambaCredo'} }) }

const sendAirtime = async (phone,amount) => { let request = await AirtimeInstance(); return request.post('version1/airtime/send', { username : ${process.env.AfricasTalkingUsername}, maxNumRetry: 2, recipients : JSON.stringify([{phoneNumber: phone, amount: KES ${amount} }]) }); }

export default sendAirtime`

Then on calling the code, do

`import sendAirtime from "./Africastalking.js"

let result = await sendAirtime("+254105730XYZ","7"); console.log(result.data)`

Hope this helps someone. Its simple though

DaggieBlanqx commented 7 months ago

@oxenprogrammer the issue on callTo parameter only initiating call to last number in array was resolved in v0.6.3. Kindly use the latest version.