Hi i need a little help, i have the below code outputted from the GOOGLE postman application.
i need to trigger this in an android app but i dont know how to initiate the below request through a button.
so when a button is pushed it will post and run the protocol below.
im using Android Studio
code from Postman on external trigger into breeze
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
RequestBody body = RequestBody.create(mediaType, "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"family\"\r\n\r\nAppButtonEXPushed\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nAppButtonEXPushedRest\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n1\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"eventBody\"\r\n\r\n{\"TheCallednumber\":\"447920441676\"}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
Request request = new Request.Builder()
.url("https://breeze2-111.collaboratory.avaya.com/services/EventingConnector/events")
.post(body)
.addHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
.addHeader("authorization", "Basic UmFqaWJvbGFAYXZheWEuY29tOkJyZWV6ZTEyMw==")
.addHeader("cache-control", "no-cache")
.addHeader("postman-token", "d7022116-c47e-f2dc-2b67-e04d604980eb")
.build();
|