Skip to main content

pindo-cli

travis fury pipy

Installation

Install from PyPi using pip, a package manager for Python.

pip3 install pindo-cli

Don't have pip installed? Try installing it, by running this from the command line:

$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python

python setup.py install

You may need to run the above commands with sudo.

Getting Started

Once you're have install Pindo CLI you're ready to go.

pindo --help

Create an account

For creating a Pindo account you need to provide your username, email, and password

pindo register

Token

Requesting a token require you to provide your username and password

pindo token

Refresh your token

pindo refresh-token

Send a test message

Sending a test message will require you providing the requested token, a receiver, the message your want to send, and also the sender id.

pindo sms

API Usage

The pindo api needs your Token. You can either pass the token directly to the constructor (see the code below) or via environment variables.

# cURL

curl -X POST \
http://api.pindo.io/v1/sms/ \
-H 'Accept: */*' \
-H 'Authorization: Bearer your-token' \
-H 'Content-Type: application/json' \
-d '{
"to" : "+250785383100", 
"text" : "Hello from Pindo",
"sender" : "Pindo"
}'
# python

import requests

token='your-token'
headers = {'Authorization': 'Bearer ' + token}
data = {'to' : '+250xxxxxxxx', 'text' : 'Hello from Pindo', 'sender' : 'Pindo'}

url = 'http://api.pindo.io/v1/sms/'
response = requests.post(url, json=data, headers=headers)
print(response)
print(response.json())
// NodeJS

var request = require("request");
data = { to: "+250xxxxxxxx", text: "Hello from Pindo", sender: "Pindo" };

var options = {
method: "POST",
body: data,
json: true,
url: "http://api.pindo.io/v1/sms/",
headers: {
Authorization: "Bearer your-token"
}
};

function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
}
//call the request

request(options, callback);
// Java

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{"to" : "+250xxxxxxxx", "text" : "Hello from Pindo","sender" : "Pindo"}");
Request request = new Request.Builder()
.url("http://api.pindo.io/v1/sms/")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer your-token")
.build();
Response response = client.newCall(request).execute();
// PHP

$request = new HttpRequest();
$request->setUrl('http://api.pindo.io/v1/sms/');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'Authorization' => 'Bearer your-token',
'Content-Type' => 'application/json'
));

$request->setBody('{
"to" : "+250xxxxxxxx", 
"text" : "Hello from Pindo",
"sender" : "Pindo"
}');

try {
$response = $request->send();

echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
// GO

package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "http://api.pindo.io/v1/sms/"

payload := strings.NewReader("{"to" : "+250xxxxxxxx", "text" : "Hello from Pindo","sender" : "Pindo"}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer your-token")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}

Release files for pindo-cli 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pindo-cli 0.1.6
File Size Uploaded
pindo-cli-0.1.6.tar.gz 4.7 kB Details

Release files / pindo-cli-0.1.6.tar.gz

Download URL pindo-cli-0.1.6.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b45f156a4ee35e93f8216c51cdc0fc07109068c76d5137ebd5b2e18bb96243dd
BLAKE2b-256 checksum
How to use checksums
809c57a4ecdc87e629ed3cf627400d3cc2c67aac73f374ac6d7d1d6ff51e9c58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

1 release file

0.1.7

1 release file

This release

0.1.6 This release

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page