Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mathdroid/bukalapak-api
🎁 Promise-based Javascript wrapper for Bukalapak API
https://github.com/mathdroid/bukalapak-api
Last synced: 5 days ago
JSON representation
🎁 Promise-based Javascript wrapper for Bukalapak API
- Host: GitHub
- URL: https://github.com/mathdroid/bukalapak-api
- Owner: mathdroid
- License: mit
- Created: 2017-04-23T11:21:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-12T03:52:09.000Z (over 7 years ago)
- Last Synced: 2024-10-14T00:19:55.136Z (about 1 month ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 21
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bukalapak-api
> 🎁 Promise-based Javascript wrapper for Bukalapak API
## Usage
```js
const {authentication} = require('bukalapak-api')const USER = {
username: '[email protected]',
password: 'hunter2'
}async function logToken (user) {
try {
const { status, token, confirmed } = await authentication.getApiToken(user)
console.log(token)
} catch (error) {
const {message} = error
console.log(message)
}
}logToken(USER)
```## API
### Authentication
#### Get API Token
- `getApiToken({ username: String, password: String })`
##### Success Response
```json
{
"status" : "OK",
"user_id" : "157324",
"user_name" : "Sayur Kangkung",
"confirmed" : true,
"token" : "U8Ch2LigkVhdI3XwYRA",
"email" : "[email protected]",
"omnikey" : "a15d3e8835c69f1c4fd6b38fe9098b4b",
"message" : null
}
```##### Failure response
```json
{
"status" : "ERROR",
"user_id" : null,
"user_name" : null,
"confirmed" : false,
"token" : null,
"email" : null,
"omnikey" : null,
"message" : "Username atau password tidak valid"
}
```#### Facebook Login
- `facebookLogin({ facebookId: String, facebookToken: String })`
##### Success Response
```json
{
"status": "OK",
"user_id": "157324",
"user_name": "Sayur Kangkung",
"token": "U8Ch2LigkVhdI3XwYRA",
"message": null
}
```##### Failure response
```json
{
"status": "ERROR",
"message": "User tidak ditemukan"
}
```#### Google Login
- `googleLogin({ email: String, googleToken: String })`
##### Success Response
```json
{
"status": "OK",
"user_id": "157324",
"user_name": "Sayur Kangkung",
"token": "U8Ch2LigkVhdI3XwYRA",
"message": null
}
```##### Failure response
```json
{
"status": "ERROR",
"message": "User tidak ditemukan"
}
```### Categories
(WIP)
### Carts
(WIP)
### Deals
(WIP)
### Dompet
(WIP)
### Errors
(WIP)
### Favorites
(WIP)
### Images
(WIP)
### Additional Informations
(WIP)
### Labels
(WIP)
### Messages
(WIP)
### Negotiations
(WIP)
### Notifications
(WIP)
### Products
(WIP)
### Product Reviews
(WIP)
### Pushes
(WIP)
### SEO Pages
(WIP)
### Shipping Fees
(WIP)
### Subscriptions
(WIP)
### Supports
(WIP)
### Transactions
(WIP)
### Users
(WIP)
(WIP)### User Addresses
## Contributing
Looking for contributors! Feel free to open issues and create PR's. Lint your code using `prettier`.
## License
MIT. See [LICENSE](./LICENSE).