Code Monkey home page Code Monkey logo

gojek's Introduction

gojek

Un-official Go-jek API Wrapper. API end point known by decompile the android APK.

This repository contains 3 main API:

  • GoID API (Authentication specific API)
  • Gojek API (core functionality for Gojek services)
  • GoPay API (GoPay specific API)

you can see list of package here

Part of my personal finance automation

Documentation

All API documented in docs directory with OpenAPI format v3.0

SDK

Available in sdk directory and generated using OpenAPI Generator

Using NodeJS

You need to setting .npmrc like this. You need personal access token in order to download the package, see here

@mychaelgo:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_REGISTRY_TOKEN}

After setup complete, now you install any package you want.

npm install @mychaelgo/goid-gojek
npm install @mychaelgo/gopay-gojek
npm install @mychaelgo/api-gojek

Using Go

WIP

gojek's People

Contributors

mychaelgo avatar ridho9 avatar ridwanfathin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gojek's Issues

Snif

apakah bisa snif apk game?
yang saya lakukan mitm dengan proxy dan bypass cert pinning, tapi hanya work di arsitektur x86,
karena kebanyakan apk game tidak dibuild ke x86

Ask mendapatkan semua API

untuk mendapatkan API url yang di versi terkahir gojek bagaimana?
dan request header yang dibutuhkan

mfa:customer_send_challenge:challenge_required

Hello!

Thanks for sharing the Swagger! I'm trying to use it as well for personal finance 👍
I receive a 403 Forbidden once I submit the OTP code:

{
    "data": null,
    "success": false,
    "errors": [
        {
            "code": "mfa:customer_send_challenge:challenge_required",
            "message": "You are forbidden",
            "message_title": "Forbidden",
            "details": {
                "challenge_token": "34e87bf1-XXXX-XXXX-XXXX-b0efc3fadef6",
                "require_all": true,
                "recovery_methods": [
                    "email"
                ],
                "ranked_mfa": [
                    {
                        "name": "GoPay Pin 2FA",
                        "enabled": true,
                        "title": "Enter GoPay PIN",
                        "subtitle": "Enter GoPay PIN"
                    },
                    {
                        "name": "App Pin 2FA",
                        "enabled": false,
                        "title": "Enter App PIN",
                        "subtitle": "Enter App PIN"
                    },
                    {
                        "name": "Email 2FA",
                        "enabled": true,
                        "title": "Get code on email",
                        "subtitle": "Get code on email"
                    },
                    {
                        "name": "In-app 2FA",
                        "enabled": true,
                        "title": "Use old phone",
                        "subtitle": "Use old phone"
                    }
                ],
                "challenges": [
                    {
                        "name": "GoPay Pin 2FA",
                        "place_holder_text": "Please enter your Gopay Pin for 2fa",
                        "gopay_challenge_id": "0d16cce1-XXXX-XXXX-XXXX-a63fad9aea14",
                        "app_pin_challenge_id": "00000000-0000-0000-0000-000000000000"
                    }
                ]
            }
        }
    ]
}

Could you please share the endpoint to pass this step?

Not getting token after calling login API

I got empty body {} after calling the login API.

var gojek = require('gojek')
gojek.login('MY_EMAIL , 'MY_PASSWORD function(error, resp    onse, body) {
         console.log(body);
 })

Result

{}

Generate Customer Token

Hi!
I'm really interested in using this for my project but I couldn't connect it, I'm stuck at generating customer token.
Are setting Unique ID and appVersion required? Since Gojek always throw error at generating customer token.

Thanks!

GoID Generate Access Token

Hi! Thanks for updating us regarding the API for goid.gojekapi.com. However, I seems to encounter a 'missing field' error when I was requesting OTP.
Below is my code:

curl -X POST \
  https://goid.gojekapi.com/goid/login/request \
  -H 'Content-Type: application/json' \
  -H 'x-user-type: customer' \
  -d '{
    "client_id": "gojek:consumer:app",
    "client_secret": "pGwQ7oi8bKqqwvid09UrjqpkMEHklb",
    "country_code": "+65",
    "login_type": "otp_whatsapp",
    "magic_link_ref": "",
    "phone_number": "MY_PHONE_NUMBER"
  }'

And this is the error:
":[{"code":"goid:error:missing_field","message":"One of the required fields is missing","message_title":"Missing information"}]}

When I am requesting the access token using example OTP, this is my code:

curl -X POST \
  https://goid.gojekapi.com/goid/token \
  -H 'Content-Type: application/json' \
  -H 'x-appversion: 4.59.1' \
  -H 'x-appid: com.gojek.app' \
  -H 'x-deviceos: Android,10' \
  -H 'x-user-type: customer' \
  -H 'x-phonemake: Samsung' \
  -H 'x-phonemodel: GT-S7500' \
  -d '{
    "client_id": "gojek:consumer:app",
    "client_secret": "pGwQ7oi8bKqqwvid09UrjqpkMEHklb",
    "grant_type": "otp",
    "data": {
        "otp": "123456",
        "otp_token": "2dee3ede-f329-4d27-802d-754205e38a22"
    },
    "scopes": []
}
'

This doesnt work and the error is the same:
{"data":null,"success":false,"errors":[{"code":"goid:error:missing_field","message":"One of the required fields is missing","message_title":"Missing information"}]}
I suppose the error is because I am using example otp and otp_token?

Besides, may I know how can I generate / find my client_secret? Cuz I have been using the default one and I think it might be a problem?

Thanks in advance :D

Gojek fare API

Hi,
Do you provide a fare API? from pick up to destination with the associated fare?

Thanks and regards
Remy

Publish new code to NPM

Version 1.1.0 on NPM still using old code.

Inside the docs, you described we need to passed page and limit parameters to getGoPayHistory function.
https://github.com/mychaelgo/gojek/blob/master/README.md#get-go-pay-transaction-history

But, in version 1.1.0 at NPM there are no page and limit parameters. Only callback.
image

After looking inside this repo, you have provided the page and limit parameters.

gojek/src/payment.js

Lines 12 to 22 in 906b95f

getGoPayHistory: function (page, limit, callback) {
var options = {
method: 'GET',
qs: {
page: page,
limit: limit
}
};
request._request(options, '/wallet/history', callback);
},

I think you just need to publish new code to NPM like version 1.1.1

Error 400 to get estimate price in singapore

const { TransportApi, Configuration } = require("@mychaelgo/api-gojek");

const configuration = new Configuration({
accessToken: "***"
});

const transportAPI = new TransportApi(configuration);

module.exports = async (req, res) => {
const payload = req.body;
try {
const defaultHeaders = {
xAppid: "com.gojek.app",
xAppversion: "4.60",
xDeviceos: "Android,10",
xPhonemake: "Samsung",
xPhonemodel: "GT-S7500",
xPlatform: "Android",
xPushtokentype: "FCM",
xUniqueid: "95f99ddd6a5d34a9",
xUserType: "customer",
xSessionId: "d31cc210-a067-4d0d-a52f-199880ea8907",
gojekCountryCode: "ID",
};

const getTransportEstimateResponse =
  await transportAPI.getTransportEstimate({
    ...defaultHeaders,
    sendPrioritisedOrder: true,
    userSelectedServiceType: 1,
    waypoints: "1.339299,103.981014|1.313135,103.952190"
  });

return res.status(200).json({
  status: "success",
  getTransportEstimateResponse: getTransportEstimateResponse.data,
});

} catch (error) {
if (error.code === "ECONNREFUSED") {
return res
.status(500)
.json({ status: "error", message: "service unavailable" });
}

return res.status(400).json({
  status: "error",
  message: error.message,
  error: error,
});

}
};

Get Transport Estimates For Other Pickup and Dropoff Locations

Hi there! Thank you for publishing this repo. I have tried to run the get-transport-estimate.js locally on my computer using a different set of latitude and longitude points for the pickup and dropoff locations, based outside of Indonesia in another country like Singapore. However, I encountered an error called .transport_pricing_service.estimate.error when requesting for transport estimates between the 2 points, using the get-transport-estimate.js file.

The latitude and longitude points that I used for the pickup and dropoff locations are:

  • Pickup point: 1.3376415,103.6947157
  • Dropoff point: 1.3475799,103.6786857

Additionally, I have already changed the country code to +65 (for Singapore) and the phone number to my phone number in the goid.js file, as shown below:

const testLoginRequest = async () => {
    const loginResponse = await tokenAPI.loginRequest({
        ...defaultHeaders,
        loginRequestBody:{
            client_id: 'gojek:consumer:app',
            client_secret: 'pGwQ7oi8bKqqwvid09UrjqpkMEHklb',
            country_code: '+65',
            login_type: 'otp_whatsapp',
            magic_link_ref: '',
            phone_number: '81464126'
        }
    });

    console.log({ loginResponse: loginResponse.data  });
};

And below is the error I faced when I ran get-transport-estimate.js, after running get-pickup-spots.js and get-dropoff-spots.js:

{
      code: '.transport_pricing_service.estimate.error',
      message: 'Don’t worry, we’re fixing this. We’ll be back for you soon!',
      message_title: 'Don’t worry, we’re fixing this. We’ll be back for you soon!',
      message_severity: 'severe'
}

May I seek your input on this error? Thank you very much! :)

[ASK] possible authentication error: getTransportEstimate

Hi Mychael and friends, after generating my gojek access token via the login and generate scripts, I have attempted calling the getTransportEstimate function. The following is my code:

import { TransportApi, Configuration } from '@mychaelgo/api-gojek';
// import 'react-native-url-polyfill/auto.js';
import GOJEK_ACCESS_TOKEN from '../../auth/token.js'; (where i stored the token)
// import getPickupGojek from './getPickupGojek';
// import getDropoffGojek from './getDropoffGojek';

const token = GOJEK_ACCESS_TOKEN;

const configuration = new Configuration({
accessToken: token
});

const transportAPI = new TransportApi(configuration);

const defaultHeaders = {
xAppid: 'com.gojek.app',
xAppversion: '4.59.1',
xDeviceos: 'Android,10',
xPhonemake: 'Samsung',
xPhonemodel: 'GT-S7500',
xPlatform: 'Android',
xPushtokentype: 'FCM',
xUniqueid: '95f99ddd6a5d34a9',
xUserType: 'customer',
xSessionId: 'd31cc210-a067-4d0d-a52f-199880ea8907',
gojekCountryCode: 'SG'
};

const FetchGojek = async () => {

const getTransportEstimateResponse = await transportAPI.getTransportEstimate({
    ...defaultHeaders,
    sendPrioritisedOrder: true,
    userSelectedServiceType: 1,
    waypoints: '1.294260,103.774320|1.3336745,103.6758544'
}, );

console.log(JSON.stringify(getTransportEstimateResponse.data));
return (getTransportEstimateResponse.data);

};
FetchGojek();

It seems that although my access_token is accurate, I am still not authenticated. Any ideas on what is wrong? The error that I have gotten is this:

Error: Request failed with status code 422
at createError (/Users/aldensio/Desktop/Gobber/Gobber-app/node_modules/@mychaelgo/api-gojek/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/aldensio/Desktop/Gobber/Gobber-app/node_modules/@mychaelgo/api-gojek/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/Users/aldensio/Desktop/Gobber/Gobber-app/node_modules/@mychaelgo/api-gojek/node_modules/axios/lib/adapters/http.js:269:11)
at IncomingMessage.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
config: {
url: 'https://api.gojekapi.com/transport/v1/estimate?send_prioritised_order=true&user_selected_service_type=1&waypoints=1.294260%2C103.774320%7C1.3336745%2C103.6758544',
method: 'get',
headers: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I',
'x-platform': 'Android',
'gojek-country-code': 'SG',
'x-uniqueid': '95f99ddd6a5d34a9',
'x-appversion': '4.59.1',
'x-appid': 'com.gojek.app',
'x-deviceos': 'Android,10',
'x-user-type': 'customer',
'x-phonemake': 'Samsung',
'x-phonemodel': 'GT-S7500',
'x-pushtokentype': 'FCM',
'x-session-id': 'd31cc210-a067-4d0d-a52f-199880ea8907',
'User-Agent': 'axios/0.21.4'
},
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus],
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
data: undefined
},
request: <ref *2> ClientRequest {
_events: [Object: null prototype] {
abort: [Function (anonymous)],
aborted: [Function (anonymous)],
connect: [Function (anonymous)],
error: [Function (anonymous)],
socket: [Function (anonymous)],
timeout: [Function (anonymous)],
finish: [Function: requestOnFinish]
},
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
socket: <ref *1> TLSSocket {
_tlsOptions: {
allowHalfOpen: undefined,
pipe: false,
secureContext: SecureContext { context: SecureContext {} },
isServer: false,
requestCert: true,
rejectUnauthorized: true,
session: undefined,
ALPNProtocols: undefined,
requestOCSP: undefined,
enableTrace: undefined,
pskCallback: undefined,
highWaterMark: undefined,
onread: undefined,
signal: undefined
},
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: 'api.gojekapi.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype] {
close: [
[Function: onSocketCloseDestroySSL],
[Function: bound onceWrapper] {
listener: [Function (anonymous)]
},
[Function: onClose],
[Function: socketCloseListener]
],
end: [Function: onReadableStreamEnd],
newListener: [Function: keylogNewListener],
secure: [Function: onConnectSecure],
session: [Function (anonymous)],
free: [Function: onFree],
timeout: [Function: onTimeout],
agentRemove: [Function: onRemove],
error: [Function: socketErrorListener],
finish: [Function: bound onceWrapper] { listener: [Function: destroy] }
},
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: 'api.gojekapi.com',
_closeAfterHandlingError: false,
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: true,
ended: false,
endEmitted: false,
reading: true,
constructed: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: false,
autoDestroy: true,
destroyed: false,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
dataEmitted: true,
decoder: null,
encoding: null,
[Symbol(kPaused)]: false
},
_maxListeners: undefined,
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: true,
needDrain: false,
ending: true,
ended: true,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
buffered: [],
bufferedIndex: 0,
allBuffers: true,
allNoop: true,
pendingcb: 1,
constructed: true,
prefinished: false,
errorEmitted: false,
emitClose: false,
autoDestroy: true,
errored: null,
closed: false,
closeEmitted: false,
[Symbol(kOnFinished)]: []
},
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: TLSWrap {
_parent: TCP {
reading: [Getter/Setter],
onconnection: null,
[Symbol(owner_symbol)]: [Circular *1]
},
_parentWrap: undefined,
_secureContext: SecureContext { context: SecureContext {} },
reading: true,
onkeylog: [Function: onkeylog],
onhandshakestart: {},
onhandshakedone: [Function (anonymous)],
onocspresponse: [F

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.