Un-official Go-jek API Wrapper written in GO. Rewrited from https://github.com/mychaelgo/gojek
You need go
installed and set GOPATH to your project. Once that is done, run the
command:
$ go get -u github.com/ridwanfathin/gojek
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)
res := gojek.LoginWithEmail('your@email.com') //[]byte
res := gojek.LoginWithPhone('+628123456789') //[]byte
After request that API, the registered phone number will receive an OTP.
You must save your login_token
to be used in next step :
res := gojek.GenerateCustomerToken('1234', 'login_token') //[]byte
Save access_token
, then call :
gojek.SetToken('access_token')
res := gojek.GetCustomerInfo()
- Param 1: Phone
- Param 2: Email
- Param 3: Name
res := gojek.EditAccount('+628123456789','email@domain.com','NAME')
res := gojek.GetGoPayDetail()
- Param 1: Page number (start from 1)
- Param 2: Limit per page
gojek.GetGoPayHistory(1, 30)
res := gojek.getGoPayQrId('+628123456789')
res := gojek.TransferGoPay('QR_ID', 10000, 'YOUR_DESCRIPTION')
- Param 1: latitude,longitude
res := gojek.GetNearestGoMart('-6.180495,106.824992')
gojek.SetToken('ACCESS_TOKEN')
gojek.SetLocation('-6.180495,106.824992')
res := gojek.GetGoFoodHome(gojek.getLocation())
- Param 1: latitude,longitude
- Param 2: Page (start from 0)
- Param 3: Limit
res := gojek.GetNearestGoFood(gojek.getLocation(), 0, 10)
- Param 1: Restaurant UUID
res := gojek.GetRestaurant('UUID')
- 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')
res := gojek.GetRestaurantsByCategory('HEALTHY_FOOD', '0', '32')
res := gojek.GetActiveBooking()
res := gojek.GetBookingHistory()
res := gojek.GetBookingByOrderNo('123456')
res := gojek.GetGoPoints()
res := gojek.NextPointsToken()
res := gojek.RedeemGoPointsToken('POINTS_TOKEN_ID')