-
Term of use
NEWPAGES Official API allow third party to use our customers data by gaining approval from our customers. You will able to manage our customer products, orders and members through the API. We have the right to revoke any approval given by our customer or disabled any developer account at anytime.
-
Register Developer Account
To use our official API you will need to register developer account from us by submitting your company details and the purpose of using the API, once we had done our review of your company then we will email developer credential to you. Register Here
-
Get Token from our Customers
Once you had our developer account, you can copy the following code and replace it with your account credential. The Unique ID is the ID that we use to recognize our developer and the redirect URL is the call back after user had approve your token request and bring the token by adding behind the redirect URL. The returned token is encrypted with your secret key.
For php code snippet:
//IV left blank function decrypt_aes128($base64_encrypted_token, $key, $iv = '') { $iv = str_pad($iv, 16, "\0"); $encrypted_token = base64_decode($base64_encrypted_token); $token = openssl_decrypt($encrypted_token, "AES-128-CBC", $key, OPENSSL_RAW_DATA, $iv); return $token; }Form sample:
<form id="form" action="https://open.newpages.com.my/connect" method="POST"> <input type="hidden" name="unique_id" value="{{ UNIQUE_ID }}"> <input type="hidden" name="redirect_url" value="{{ REDIRECT_URL }}"> <button type="submit"> Get Access Token </button> </form>If the form had been submit successfully you will see the following image.
-
Using the API
You need to store the decrypted token some where and all the api request are required to submit the token under http header. For complete api documentation you may see here.
-
Demo and Test
We provide a testing interface for you to test your developer credential. Just replace the {{ UNIQUE_ID }} with your unique ID to test.
https://open.newpages.com.my/test/unique_id/{{ UNIQUE_ID }}