Skip to content

Latest commit

 

History

History
220 lines (181 loc) · 5.83 KB

messages.md

File metadata and controls

220 lines (181 loc) · 5.83 KB

Bukalapak Messages API

Bukalapak Messages API

Get Inbox

Get current user's inbox

  • Use GET http method.
Resource URL
Parameters

None

Example Request
curl -u 67287:lXymG93y83m6RHzZV5FY https://api.bukalapak.com/v1/messages.json
Example Response
{
	"status":"OK",
	"unread":0,
	"inbox":[{"id":"518d0d42318b276640000009","updated_at":"2013-07-04T11:47:35+07:00","partner_id":"6","partner_name":"Administrator","user_id":"15","user_name":"Me Ow"},{"id":"515417c4318b273063000014","updated_at":"2013-04-18T23:01:18+07:00","partner_id":"46688","partner_name":"Cust.Service BukaLapak ","user_id":"15","user_name":"Me Ow"}]
}

Get Conversation

Get current user's selected conversation

  • Use GET http method.
Resource URL
Parameters

None

Example Request
curl -u 67287:lXymG93y83m6RHzZV5FY https://api.bukalapak.com/v1/messages/516d3299425762188f000011.json
Example Response
{
	"status":"OK",
	"instant_messages":[{"_id":"516e2565177961034c000002","attachment_id":0,"body":"tesssss","body_bb":"tesssss","category":0,"created_at":"2013-04-17T11:30:29+07:00","inbox_id":"516d3299425762188f000011","product_id":null,"read":true,"receiver_id":"110675","receiver_name":"Phillip Leonardo","removed":false,"sender_id":"110677","sender_name":"Testa B","updated_at":"2013-04-17T11:30:29+07:00"}],
	"message":null
}

Get Message

Get current user's selected message

  • Use GET http method.
Resource URL
Parameters

None

Example Request
curl -u 67287:lXymG93y83m6RHzZV5FY https://api.bukalapak.com/v1/messages/im/516e2565177961034c000002.json
Example Response
{
	"status":"OK",
	"instant_message":{"_id":"516e2565177961034c000002","attachment_id":0,"body":"tesssss","body_bb":"tesssss","category":0,"created_at":"2013-04-17T11:30:29+07:00","inbox_id":"516d3299425762188f000011","product_id":null,"read":true,"receiver_id":"110675","receiver_name":"Phillip Leonardo","removed":false,"sender_id":"110677","sender_name":"Testa B","updated_at":"2013-04-17T11:30:29+07:00"},
	"message":null
}

Create Message

Create a new message

  • Use POST http method.
  • Requires authentication
Resource URL
Parameters

None

POST request data
  • instant_message (required). New message to be sent, which contains:
    • receiver_id (required). Message receiver's user ID
    • category (required). Message category: '0' => normal message, '1' => question, '2' => suggestion, '3' => feature, '4' => transaction, note that for category > 0 must be addressed to admin
    • body_bb (required). Message's content
Example Request
curl -u 110677:JheQQS0OKApu3hGJwkRH -d '{ "instant_message":{"receiver_id":"110675", "category":"0", "body_bb":"tesssss"} }' https://api.bukalapak.com/v1/messages.json -H "Content-Type: application/json" -X POST
Example Response

Failed example

{
	"status":"ERROR",
	"id":null,
	"message": "Gagal mengirim pesan: harap menggunakan format yang seharusnya"
}
{
	"status":"ERROR",
	"id":null,
	"message": "Gagal mengirim pesan"
}
{
	"status":"ERROR",
	"id":null,
	"message": "Pengiriman pesan untuk kategori ini hanya dapat ditujukan kepada admin"
}

Successfull example

{
	"status":"OK",
	"id":"516d303c425762188f000007",
	"message": null
}

Delete Conversation

Delete existing conversation

  • Use DELETE http method.
  • Requires authentication
Resource URL
Parameters
  • id (required). Identifier for product being destroy.
Example Request
curl -u 110677:JheQQS0OKApu3hGJwkRH https://api.bukalapak.com/v1/messages/516d3299425762188f000011.json -H "Content-Type: application/json" -X DELETE
Example Response

Successfull example

{
	"status":"OK",
	"id":"516d3299425762188f000011",
	"message": "Conversation berhasil dihapus"
}

Delete Message

Delete existing message

  • Use DELETE http method.
  • Requires authentication
Resource URL
Parameters
  • id (required). Identifier for product being destroy.
Example Request
curl -u 110677:JheQQS0OKApu3hGJwkRH https://api.bukalapak.com/v1/messages/516d3299425762188f000015.json -H "Content-Type: application/json" -X DELETE
Example Response

Successfull example

{
	"status":"OK",
	"id":"516d3299425762188f000015",
	"message": "Pesan berhasil dihapus"
}