criptext-monkey-api

Criptext library to call to the REST API of the Monkey Protocol

Showing:

Popularity

Downloads/wk

39

GitHub Stars

0

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

1

License

Apache-2.0

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Monkey-API

Criptext node JS library to call to the REST API of the Monkey Protocol.

Request example to send push notification to a known monkey ID.


    let MonkeyApi = require('criptext-monkey-api');

    monkeyApi = new MonkeyApi("<API-ID>","<API-KEY>");


    let dataJSON={
        users_to:"<MonkeyId1>,<MonkeyId2>",
        payload:{"text": "TeXt received in the push"}
    }

 monkeyApi.basicRequest("POST", "/push/new", dataJSON, function(error, objResponse){

        if(error != null){
            console.log("DATA ERROR "+error);
            return;
    }

    console.log("DATA SC "+JSON.stringify(jsonObjectRes));

});

Request example to send a message to a known monkey ID.


        let monkeyApi = new MonkeyApi("<API-ID>","<API-KEY>");

    let temporalId=String(Math.round((new Date().getTime() / 1000) * -1));

    const dataJSON={
        messageData:{
            "app_id":"<API-ID>",
            "id":temporalId,
            "sid":"<MonkeyIdSender>",
            "rid":"<MonkeyIdReceiver>",
            "type":1, // is a text
            "msg": new Buffer(payload.text).toString('base64') , // Sending text with special chars and encoding with Base64
            "props": {encr:0, encoding:"base64" },
            "datetime":(new Date().getTime() / 1000),
                    "push": JSON.stringify({text:"pushText", andData:{alert: "pushText" }})
        }
    }

    monkeyApi.basicRequest("POST", "/message/send", dataJSON, callback);

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial