Connecting to Mocean
Using API Key Authentication
Mocean uses API key authentication to control access to the API. To obtain an API Key:
- Log in to your Mocean account at https://dashboard.moceanapi.com
- Navigate to your account settings or API credentials section
- Copy your API Key
After obtaining your API Key, set the following connection properties:
- AuthScheme: Set this to APIKey.
- APIKey: Set this to your Mocean API Key. This is transmitted as a Bearer token in the Authorization header.
Example Connection String
Profile=C:\profiles\Mocean.apip;AuthScheme=APIKey;ProfileSettings='APIKey=your_api_key';
Connecting to Mocean
Once the authentication is configured, you can connect to Mocean and query data from any of the available tables such as AccountBalance, AccountPricing, MessageStatus, and NumberLookup.
Available Tables
The Mocean API Profile provides access to the following tables:
- AccountBalance: Retrieve the current account balance and credit value for the connected Mocean account
- AccountPricing: Retrieve SMS pricing information per destination country, operator, MCC, and MNC
- MessageStatus: Query the delivery status of a previously sent SMS message (requires Msgid)
- NumberLookup: Retrieve mobile number portability and carrier information for a phone number (requires PhoneTo)
Important Notes
- The Mocean API defaults to XML responses; the profile automatically appends
mocean-resp-format=jsonto all requests. - MessageStatus requires a Msgid from a previously sent SMS message returned by the Mocean SMS send API.
- NumberLookup requires a phone number in international format including country code (e.g. 60123456789 for Malaysia).
- NumberLookup is a POST request that consumes credits from your account balance.
- AccountPricing returns one row per destination operator; results may vary based on your account configuration.
Usage Examples
AccountBalance:
SELECT * FROM AccountBalance
AccountPricing:
SELECT * FROM AccountPricing
MessageStatus:
SELECT * FROM MessageStatus WHERE Msgid = 'your_message_id'
NumberLookup:
SELECT * FROM NumberLookup WHERE PhoneTo = '60123456789'
API Documentation
For more information about the Mocean API, see the official Mocean API documentation at https://moceanapi.com/docs.
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| APIKey | The API Key for your Mocean account. |
| AuthScheme | The scheme used for authentication. Accepted entries are APIKey or None. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT |