{"id":15388891,"url":"https://github.com/killercodemonkey/websms","last_synced_at":"2025-06-13T17:32:32.195Z","repository":{"id":26329251,"uuid":"29777805","full_name":"KillerCodeMonkey/websms","owner":"KillerCodeMonkey","description":"Custom nodejs sdk for websms.com services","archived":false,"fork":false,"pushed_at":"2015-09-07T12:19:54.000Z","size":206,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T19:46:03.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KillerCodeMonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-24T13:45:28.000Z","updated_at":"2018-12-13T19:04:57.000Z","dependencies_parsed_at":"2022-07-14T00:40:39.384Z","dependency_job_id":null,"html_url":"https://github.com/KillerCodeMonkey/websms","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/KillerCodeMonkey/websms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KillerCodeMonkey%2Fwebsms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KillerCodeMonkey%2Fwebsms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KillerCodeMonkey%2Fwebsms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KillerCodeMonkey%2Fwebsms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KillerCodeMonkey","download_url":"https://codeload.github.com/KillerCodeMonkey/websms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KillerCodeMonkey%2Fwebsms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259688354,"owners_count":22896390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T14:58:32.528Z","updated_at":"2025-06-13T17:32:32.174Z","avatar_url":"https://github.com/KillerCodeMonkey.png","language":"JavaScript","readme":"websms.js [![Build Status](https://travis-ci.org/KillerCodeMonkey/websms.svg?branch=master)](https://travis-ci.org/KillerCodeMonkey/websms)\n=========\nCustom nodejs sdk for websms.com services\n\nThis module should be a better and stable implementation of the original websms.com sdk.\nhttps://websms.com/\n\nNo additional dependencies!\n\n### It is a SMS text/binary messaging tool for node.js\n\n`websms.js` module provides an easy-to-use API for sending SMS text and binary messages through websms.com API (`https://api.websms.com`).\n \nSimple examples can be found in the `examples.js`.\n\n#### Features:\n\n * Text Messages\n * Binary Messages\n * Confirmation of Delivery\n * Answers to SMS can be forwarded\n * Only usable in modules\n\nSee [websms.com](http://websms.com) website to [register](http://business.sms.at/get-started/online-anmeldung) for an account.\n\nFor general API specification of the server (nodejs independent) visit: [https://api.websms.com](https://api.websms.com)\n\nInstallation\n------------\n\nInstall with `npm`:\n\n```bash\n$ npm install websms\n```\n\nTests\n----\n\nTests are runnable after running `npm install`. (mocha and expect.js as devDependencies)\n\n```bash\n$ mocha spec/tests\n```\n\nUsage\n-----\n1. require\n\n  ```\n  var websms = require('websms');\n  ```\n2. Create a client object (once)\n\n  ```\n  var client = new websms.Client(username, password);\n  ```\n3. Create a Message object (or many)\n\n  ```\n  var TextMessage = new websms.TextMessage(unicodeMessageText, recipientAddressList);\n  ```\n4. Send Message object over Client\n\n  ```\n  client.send(TextMessage, maxSmsPerMessage, isTest, callback);\n  ```\n\n#### Parameters explained:\n * __username__   : {string}username used in basic authentication. This is your websms.com account username\n * __password__   : {string} password used in basic authentication  This is your websms.com account password\n * __recipientAddressList__ : {Array} of strings containing message recipient mobile numbers (MSISDN) like ['4367612345678','4369912345678']\n * __unicodeMessageText__ : {string} messageContent string sent that will be included in JSON object and sent as charset utf-8 to API. Special characters should be escaped as unicode. Euro sign is \\u20AC.\n * __maxSmsPerMessage__ : {Number} integer number 1-255 telling how many concatenated sms parts are the limit for sending this message. (in case the text is longer than what fits into multiple sms)\n * __isTest__ : {boolean} false to really send sms. true to just test interface connection and process\n * __callback__ : {Function} function that is called after success or error - parameter: error, response\n\n----\n\nQuick Message Construction\n--------------------------\n\nYou don't need to use setter methods, it's also possible create a message with all properties at once:\n\n    TextMessage = new websms.TextMessage(messageContent, recipientAddressList, {\n           'senderAddress'           : \"AlphanumericSender\",\n           'senderAddressType'       : 'alphanumeric',  // also possible values: 'shortcode', 'international', 'national\n           'sendAsFlashSms'          : true,\n           'priority'                : 1,\n           'notificationCallbackUrl' : 'https://my_server_for_send_notification',\n           'clientMessageId'         : \"My custom message id\"\n        });\n\nIf there was an error during message creation -\u003e you can find it on TextMessage.error (object with cause, message as keys).\nIf you not check this the Client.send method will do it and calling your sending callback with that error object.\n\nCallback function format\n------------------------\n#### callback(error, response)\n\n    function (error, response) {\n        // error = {\n        //   cause: String with error code \n        //   message: String with error message\n        // }\n        \n        // repsonse = if request was successfully sent -\u003e this is the response object\n        var statusCode      = repsonse.statusCode;\n        var statusMessage   = repsonse.statusMessage;\n        var transferId      = repsonse.transferId;\n        var clientMessageId = repsonse.clientMessageId;\n    };\n\n----\n\nClasses\n-------\n#### Client\n \u003e new websms.Client(*user, password*)\n \n ##### Methods/Functions\n     Client.send(messageObject, maxSmsPerMessage, isTest, callback)\n     \n#### TextMessage\n \u003e new websms.TextMessage(*messageContent, recipientAddressList, optionalOptions*)\n\n ##### Methods/Functions\n     TextMessage.getMessageContent()\n\n#### BinaryMessage\n \u003e new websms.BinaryMessage(*messageContentSegments, recipientAddressList, userDataHeaderPresent, optionalOptions*)\n \n ##### Methods/Functions\n     BinaryMessage.getMessageContent()\n     BinaryMessage.getUserDataHeader()\n     BinaryMessage.setUserDataHeader(userDataHeader)\n\n#### Message\n \u003e Base class for all messages  (every message inherits from Event.Emitter)\n\n ##### Methods/Functions\n     Message.getRecipientAddressList()\n     Message.getSenderAddress()\n     Message.setSenderAddress(senderAddress)\n     Message.getSenderAddressType()\n     Message.setSenderAddressType(senderAddressType)\n     Message.getSendAsFlashSms()\n     Message.setSendAsFlashSms(sendAsFlashSms)\n     Message.getNotificationCallbackUrl()\n     Message.setNotificationCallbackUrl(notificationCallbackUrl)\n     Message.getClientMessageId()\n     Message.setClientMessageId(clientMessageId)\n     Message.getPriority()\n     Message.setPriority(priority)\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/KillerCodeMonkey/websms/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillercodemonkey%2Fwebsms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkillercodemonkey%2Fwebsms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillercodemonkey%2Fwebsms/lists"}