Getting Started

The Card API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

All API uses API secret keys to authenticate requests. Any request that doesn't include an API key will return an error.

Issuing API Credentials

Generate an API secret key for signing requests (see the next section for how to sign requests with the API secret key)::

* Signature argorithm:

SHA1WithRSA

First, Run the following command line to generate an RSA 2048 private key (stored in muse_secret.key):

//generate new private key
openssl req -new -newkey rsa:2048 -nodes -keyout muse_secret.key

//export public key from private key
openssl rsa -in muse_secret.key -pubout

Make sure you keep the API secret key safe and secure!

Then go to the dashboard and upload the public key. MuseCard will use your public key to verify the API calls.

Also remember to download MuseCard's public key as you need to verify the notification from MuseCard API.

Signing a Request

All API calls must be authenticated.

  • all the fields should be sorted in alphabetical order by the key

  • Empty field should be exclude from the signature.

  • fields key name are case sensitive

For example:

assume the raw data are below:

step 1: the data should be put in the format of 'key=value' ,and sorted in alphabetical order by the key.

step 2: attach the api signature

Code example(JAVA)
Code example(Javascript)
Code example(PHP)

step 3: finally get the request data

IP Whitelisting

MuseCard supports restriction of API calls to be accepted only from a specific IP address per API key. If you wish to whitelist your IP address, please contact our technical support with the IP of the machine running your API client and the matching API key.

Last updated