Un-official Go-jek API Wrapper. API end point known by decompile the android APK.
npm i gojek
Include Go-jek module
var gojek = require('gojek');
Use token
for every request.
See how to get token with login API
By default the module set the location
, uniqueId
and appVersion
. This value used to every request to the Go-Jek API. You can set manually if you need.
gojek.setUniqueId('YOUR_UNIQUE_ID');
gojek.setAppVersion('YOUR_APP_VERSION');
By default the token is not set by this module. You can set token after you call a login API
gojek.setToken('YOUR_TOKEN');
Go-Jek support 2 method for login (Email or Phone number login)
gojek.loginWithEmail('[email protected]', function(error ,response, body){
console.log(body);
});
gojek.loginWithPhone('+628123456789', function(error ,response, body){
console.log(body);
});
After request that API, the registered phone number will receive an OTP.
You must save your login_token
to be used in next step :
gojek.generateCustomerToken('1234', 'login_token', function(error ,response, body){
console.log(body);
});
Save access_token
, then call :
gojek.setToken('access_token');
gojek.getCustomerInfo(function (err, res, body) {
console.log(body);
});
- Param 1: Phone
- Param 2: Email
- Param 3: Name
gojek.editAccount('+628123456789','[email protected]','NAME', function (err, res, body) {
console.log(body);
});
gojek.getGoPayDetail(function (err, res, body) {
console.log(body);
});
- Param 1: Page number (start from 1)
- Param 2: Limit per page
gojek.getGoPayHistory(1, 30, function (err, res, body) {
console.log(body);
});
gojek.getGoPayQrId('+628123456789', function (err, res, body) {
console.log(body);
});
gojek.transferGoPay('QR_ID', 10000, 'YOUR_DESCRIPTION', function (err, res, body) {
console.log(body);
});
- Param 1: latitude,longitude
gojek.getNearestGoMart('-6.180495,106.824992', function (err, res, body) {
console.log(body);
});
gojek.setToken('ACCESS_TOKEN');
gojek.setLocation('-6.180495,106.824992');
gojek.getGoFoodHome(gojek.getLocation(), function (err, res, body) {
console.log(body);
});
- Param 1: latitude,longitude
- Param 2: Page (start from 0)
- Param 3: Limit
gojek.getNearestGoFood(gojek.getLocation(), 0, 10, function (err, res, body) {
console.log(body);
});
- Param 1: Restaurant UUID
gojek.getRestaurant('UUID', function (err, res, body) {
console.log(body);
});
- Param 1: Category code (Can be seen on get go-food home)
- Param 2: Page number (start from 0)
- Param 3: Limit per page
gojek.setToken('ACCESS_TOKEN');
gojek.setLocation('-6.180495,106.824992');
gojek.getRestaurantsByCategory('HEALTHY_FOOD', '0', '32', function (err, res, body) {
console.log(body);
});
gojek.getActiveBooking(function (err, res, body) {
console.log(body);
});
gojek.getBookingHistory(function (err, res, body) {
console.log(body);
});
gojek.getBookingByOrderNo('123456', function (err, res, body) {
console.log(body);
});
gojek.getGoPoints(function (err, res, body) {
console.log(body);
});
gojek.nextPointsToken(function (err, res, body) {
console.log(body);
});
gojek.redeemGoPointsToken('POINTS_TOKEN_ID',function (err, res, body) {
console.log(body);
});