RapidAPI logo

MoceanAPI

FREE
By donald544.mocean
Updated 4 months ago
6.7/10
Popularity Score
1235ms
Latency
-
Success Rate

MoceanAPI API Documentation

MoceanAPI makes sending SMS and 2FA verification easy.

View API Details
SMS API
POSTSend SMS
Verify API
POSTSend Code
POSTVerify Code
Query API
GETGet Balance
GETAccount Pricing
GETMessage Status
POSTSend SMS

Send an outbound SMS

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
mocean-api-keySTRING
REQUIREDYour account API key.
mocean-api-secretSTRING
REQUIREDYour account API secret.
mocean-fromSTRING
REQUIREDSMS Sender Name
mocean-toNUMBER
REQUIREDPhone number of the receiver. Note: phone number must include country code prefix.
mocean-textSTRING
REQUIREDContents of the message, URL encoded as necessary.
Optional Parameters
mocean-resp-formatSTRING
OPTIONALBy default, response will be returned in XML format. Change value to `json` to get responses in json format.
Code Snippet
unirest.post("https://donald544-mocean-moceanapi-v1.p.rapidapi.com/rest/1/sms")
.header("X-RapidAPI-Host", "donald544-mocean-moceanapi-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("mocean-to=60168308600")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://donald544-mocean-moceanapi-v1.p.rapidapi.com/rest/1/sms
Request Method: POST
Response Headers
Response Body
<?xml version="1.0"?><result><message><status>0</status><receiver>60168308600</receiver><msgid>CPASS_restapi_C0725184746813621.0002</msgid></message></result>
Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://donald544-mocean-moceanapi-v1.p.rapidapi.com/rest/1/sms")
.header("X-RapidAPI-Host", "donald544-mocean-moceanapi-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("mocean-to=60168308600")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication