Copy to Clipboard curl --request POST \
--url http://micro.fuse.co.id/stage-x-api/creditFailure/makeOrder \
--header 'apikey: DdfPbcNdK98uqrhe' \
--header 'signature: A6D4806FCBC795A1F87C391ECF50C089' \
--data '{"noRef":"CF-55312","customer":{"Name":"John Doe","idCard":"123456789","dateOfBirth":"2019-08-02","address":"Jl. Contoh alamat","city":"Kota","zipCode":"123456","occupation":"Karyawan","phoneNumber":"0211234567","mobilePhone":"02112345678","email":"contoh@email.com"},"insuredBeneficiary":[{"name":"John Doe Child","relationship":"Anak","percentage":"25"},{"name":"John Doe Wife","relationship":"Istri","percentage":"75"}],"insuredDetail":{"totalSumInsured":"12000200","package":"SAMPLEPACKAGE","inseptionDate":"2019-08-02","premium":"30000","duration":"30"},"callBackUrl":"https:\/\/www.yourdomain.com\/callbackapi"}'
Copy to Clipboard <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://micro.fuse.co.id/stage-x-api/creditFailure/makeOrder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"noRef\":\"CF-55312\",\"customer\":{\"Name\":\"John Doe\",\"idCard\":\"123456789\",\"dateOfBirth\":\"2019-08-02\",\"address\":\"Jl. Contoh alamat\",\"city\":\"Kota\",\"zipCode\":\"123456\",\"occupation\":\"Karyawan\",\"phoneNumber\":\"0211234567\",\"mobilePhone\":\"02112345678\",\"email\":\"contoh@email.com\"},\"insuredBeneficiary\":[{\"name\":\"John Doe Child\",\"relationship\":\"Anak\",\"percentage\":\"25\"},{\"name\":\"John Doe Wife\",\"relationship\":\"Istri\",\"percentage\":\"75\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"inseptionDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}",
CURLOPT_HTTPHEADER => array(
"apikey: DdfPbcNdK98uqrhe",
"signature: A6D4806FCBC795A1F87C391ECF50C089"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Copy to Clipboard require 'uri'
require 'net/http'
url = URI("http://micro.fuse.co.id/stage-x-api/creditFailure/makeOrder")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["apikey"] = 'DdfPbcNdK98uqrhe'
request["signature"] = 'A6D4806FCBC795A1F87C391ECF50C089'
request.body = "{\"noRef\":\"CF-55312\",\"customer\":{\"Name\":\"John Doe\",\"idCard\":\"123456789\",\"dateOfBirth\":\"2019-08-02\",\"address\":\"Jl. Contoh alamat\",\"city\":\"Kota\",\"zipCode\":\"123456\",\"occupation\":\"Karyawan\",\"phoneNumber\":\"0211234567\",\"mobilePhone\":\"02112345678\",\"email\":\"contoh@email.com\"},\"insuredBeneficiary\":[{\"name\":\"John Doe Child\",\"relationship\":\"Anak\",\"percentage\":\"25\"},{\"name\":\"John Doe Wife\",\"relationship\":\"Istri\",\"percentage\":\"75\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"inseptionDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}"
response = http.request(request)
puts response.read_body
Copy to Clipboard #import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"apikey": @"DdfPbcNdK98uqrhe",
@"signature": @"A6D4806FCBC795A1F87C391ECF50C089" };
NSDictionary *parameters = @{ @"noRef": @"CF-55312",
@"customer": @{ @"Name": @"John Doe", @"idCard": @"123456789", @"dateOfBirth": @"2019-08-02", @"address": @"Jl. Contoh alamat", @"city": @"Kota", @"zipCode": @"123456", @"occupation": @"Karyawan", @"phoneNumber": @"0211234567", @"mobilePhone": @"02112345678", @"email": @"contoh@email.com" },
@"insuredBeneficiary": @[ @{ @"name": @"John Doe Child", @"relationship": @"Anak", @"percentage": @"25" }, @{ @"name": @"John Doe Wife", @"relationship": @"Istri", @"percentage": @"75" } ],
@"insuredDetail": @{ @"totalSumInsured": @"12000200", @"package": @"SAMPLEPACKAGE", @"inseptionDate": @"2019-08-02", @"premium": @"30000", @"duration": @"30" },
@"callBackUrl": @"https://www.yourdomain.com/callbackapi" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://micro.fuse.co.id/stage-x-api/creditFailure/makeOrder"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
Copy to Clipboard import Foundation
let headers = [
"apikey": "DdfPbcNdK98uqrhe",
"signature": "A6D4806FCBC795A1F87C391ECF50C089"
]
let parameters = [
"noRef": "CF-55312",
"customer": [
"Name": "John Doe",
"idCard": "123456789",
"dateOfBirth": "2019-08-02",
"address": "Jl. Contoh alamat",
"city": "Kota",
"zipCode": "123456",
"occupation": "Karyawan",
"phoneNumber": "0211234567",
"mobilePhone": "02112345678",
"email": "contoh@email.com"
],
"insuredBeneficiary": [
[
"name": "John Doe Child",
"relationship": "Anak",
"percentage": "25"
],
[
"name": "John Doe Wife",
"relationship": "Istri",
"percentage": "75"
]
],
"insuredDetail": [
"totalSumInsured": "12000200",
"package": "SAMPLEPACKAGE",
"inseptionDate": "2019-08-02",
"premium": "30000",
"duration": "30"
],
"callBackUrl": "https://www.yourdomain.com/callbackapi"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "http://micro.fuse.co.id/stage-x-api/creditFailure/makeOrder")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Copy to Clipboard import http.client
conn = http.client.HTTPConnection("micro.fuse.co.id")
payload = "{\"noRef\":\"CF-55312\",\"customer\":{\"Name\":\"John Doe\",\"idCard\":\"123456789\",\"dateOfBirth\":\"2019-08-02\",\"address\":\"Jl. Contoh alamat\",\"city\":\"Kota\",\"zipCode\":\"123456\",\"occupation\":\"Karyawan\",\"phoneNumber\":\"0211234567\",\"mobilePhone\":\"02112345678\",\"email\":\"contoh@email.com\"},\"insuredBeneficiary\":[{\"name\":\"John Doe Child\",\"relationship\":\"Anak\",\"percentage\":\"25\"},{\"name\":\"John Doe Wife\",\"relationship\":\"Istri\",\"percentage\":\"75\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"inseptionDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}"
headers = {
'apikey': "DdfPbcNdK98uqrhe",
'signature': "A6D4806FCBC795A1F87C391ECF50C089"
}
conn.request("POST", "/stage-x-api/creditFailure/makeOrder", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Copy to Clipboard package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "http://micro.fuse.co.id/stage-x-api/creditFailure/makeOrder"
payload := strings.NewReader("{\"noRef\":\"CF-55312\",\"customer\":{\"Name\":\"John Doe\",\"idCard\":\"123456789\",\"dateOfBirth\":\"2019-08-02\",\"address\":\"Jl. Contoh alamat\",\"city\":\"Kota\",\"zipCode\":\"123456\",\"occupation\":\"Karyawan\",\"phoneNumber\":\"0211234567\",\"mobilePhone\":\"02112345678\",\"email\":\"contoh@email.com\"},\"insuredBeneficiary\":[{\"name\":\"John Doe Child\",\"relationship\":\"Anak\",\"percentage\":\"25\"},{\"name\":\"John Doe Wife\",\"relationship\":\"Istri\",\"percentage\":\"75\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"inseptionDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "DdfPbcNdK98uqrhe")
req.Header.Add("signature", "A6D4806FCBC795A1F87C391ECF50C089")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Copy to Clipboard var http = require("http");
var options = {
"method": "POST",
"hostname": "micro.fuse.co.id",
"port": null,
"path": "/stage-x-api/creditFailure/makeOrder",
"headers": {
"apikey": "DdfPbcNdK98uqrhe",
"signature": "A6D4806FCBC795A1F87C391ECF50C089"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
noRef: 'CF-55312',
customer: {
Name: 'John Doe',
idCard: '123456789',
dateOfBirth: '2019-08-02',
address: 'Jl. Contoh alamat',
city: 'Kota',
zipCode: '123456',
occupation: 'Karyawan',
phoneNumber: '0211234567',
mobilePhone: '02112345678',
email: 'contoh@email.com'
},
insuredBeneficiary: [
{name: 'John Doe Child', relationship: 'Anak', percentage: '25'},
{name: 'John Doe Wife', relationship: 'Istri', percentage: '75'}
],
insuredDetail: {
totalSumInsured: '12000200',
package: 'SAMPLEPACKAGE',
inseptionDate: '2019-08-02',
premium: '30000',
duration: '30'
},
callBackUrl: 'https://www.yourdomain.com/callbackapi'
}));
req.end();
Copy to Clipboard OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"noRef\":\"CF-55312\",\"customer\":{\"Name\":\"John Doe\",\"idCard\":\"123456789\",\"dateOfBirth\":\"2019-08-02\",\"address\":\"Jl. Contoh alamat\",\"city\":\"Kota\",\"zipCode\":\"123456\",\"occupation\":\"Karyawan\",\"phoneNumber\":\"0211234567\",\"mobilePhone\":\"02112345678\",\"email\":\"contoh@email.com\"},\"insuredBeneficiary\":[{\"name\":\"John Doe Child\",\"relationship\":\"Anak\",\"percentage\":\"25\"},{\"name\":\"John Doe Wife\",\"relationship\":\"Istri\",\"percentage\":\"75\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"inseptionDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}");
Request request = new Request.Builder()
.url("http://micro.fuse.co.id/stage-x-api/creditFailure/makeOrder")
.post(body)
.addHeader("apikey", "DdfPbcNdK98uqrhe")
.addHeader("signature", "A6D4806FCBC795A1F87C391ECF50C089")
.build();
Response response = client.newCall(request).execute();
Copy to Clipboard var client = new RestClient("http://micro.fuse.co.id/stage-x-api/creditFailure/makeOrder");
var request = new RestRequest(Method.POST);
request.AddHeader("apikey", "DdfPbcNdK98uqrhe");
request.AddHeader("signature", "A6D4806FCBC795A1F87C391ECF50C089");
request.AddParameter("undefined", "{\"noRef\":\"CF-55312\",\"customer\":{\"Name\":\"John Doe\",\"idCard\":\"123456789\",\"dateOfBirth\":\"2019-08-02\",\"address\":\"Jl. Contoh alamat\",\"city\":\"Kota\",\"zipCode\":\"123456\",\"occupation\":\"Karyawan\",\"phoneNumber\":\"0211234567\",\"mobilePhone\":\"02112345678\",\"email\":\"contoh@email.com\"},\"insuredBeneficiary\":[{\"name\":\"John Doe Child\",\"relationship\":\"Anak\",\"percentage\":\"25\"},{\"name\":\"John Doe Wife\",\"relationship\":\"Istri\",\"percentage\":\"75\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"inseptionDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);