Skip to content

Instantly share code, notes, and snippets.

@kaaroIndus
Created February 3, 2023 12:19
Show Gist options
  • Save kaaroIndus/fdf0120a9bf9b95b57cf2ca8c1aaf64c to your computer and use it in GitHub Desktop.
Save kaaroIndus/fdf0120a9bf9b95b57cf2ca8c1aaf64c to your computer and use it in GitHub Desktop.
Upload APK to App Bazaar Platform using DevTools API
const axios = require('axios');
// Dev Tools Secret from Developer Dashboard portal
let authToken = "<-Dev tools secret->";
// Step 1: request ShortLived Auth token from Secret
axios.post("https://staging-developerapi.appbazaar.com/devapi/auth/token", {}, {
headers: {
Authorization: `Bearer ${authToken}`
}
}).then(response => {
console.log(response);
if (response.accessToken) {
// Step 2: Using Access Token upload APK file for your package
axios.post({
url: "https://appbazaarapi.com/devapi/edit/apk/upgrade?package=com.indusos.apps.dummy.931802",
headers: {
Authorization: `Bearer ${response.accessToken}`
},
body: {
file: ATTACH_APK_HERE
}
})
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment