curl --request POST \
--url http://micro.fuse.co.id/stage-x-api/moveableAllRisk/makeOrder \
--header 'apikey: DdfPbcNdK98uqrhe' \
--header 'signature: 3EC2677A896241FBFAED847A348E51EE' \
--data '{"noRef":"MAR-57521","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"},"insuredObject":[{"brand":"Samsung","type":"M20","imei":"12345678912345","price":"6000000"},{"brand":"Apple","type":"Iphone X","imei":"12345678912346","price":"6000200"}],"insuredDetail":{"totalSumInsured":"12000200","package":"SAMPLEPACKAGE","paymentDate":"2019-08-02","premium":"30000","duration":"30"},"callBackUrl":"https:\/\/www.yourdomain.com\/callbackapi"}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://micro.fuse.co.id/stage-x-api/moveableAllRisk/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\":\"MAR-57521\",\"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\"},\"insuredObject\":[{\"brand\":\"Samsung\",\"type\":\"M20\",\"imei\":\"12345678912345\",\"price\":\"6000000\"},{\"brand\":\"Apple\",\"type\":\"Iphone X\",\"imei\":\"12345678912346\",\"price\":\"6000200\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"paymentDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}",
CURLOPT_HTTPHEADER => array(
"apikey: DdfPbcNdK98uqrhe",
"signature: 3EC2677A896241FBFAED847A348E51EE"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'uri'
require 'net/http'
url = URI("http://micro.fuse.co.id/stage-x-api/moveableAllRisk/makeOrder")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["apikey"] = 'DdfPbcNdK98uqrhe'
request["signature"] = '3EC2677A896241FBFAED847A348E51EE'
request.body = "{\"noRef\":\"MAR-57521\",\"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\"},\"insuredObject\":[{\"brand\":\"Samsung\",\"type\":\"M20\",\"imei\":\"12345678912345\",\"price\":\"6000000\"},{\"brand\":\"Apple\",\"type\":\"Iphone X\",\"imei\":\"12345678912346\",\"price\":\"6000200\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"paymentDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}"
response = http.request(request)
puts response.read_body
#import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"apikey": @"DdfPbcNdK98uqrhe",
@"signature": @"3EC2677A896241FBFAED847A348E51EE" };
NSDictionary *parameters = @{ @"noRef": @"MAR-57521",
@"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" },
@"insuredObject": @[ @{ @"brand": @"Samsung", @"type": @"M20", @"imei": @"12345678912345", @"price": @"6000000" }, @{ @"brand": @"Apple", @"type": @"Iphone X", @"imei": @"12345678912346", @"price": @"6000200" } ],
@"insuredDetail": @{ @"totalSumInsured": @"12000200", @"package": @"SAMPLEPACKAGE", @"paymentDate": @"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/moveableAllRisk/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];
import Foundation
let headers = [
"apikey": "DdfPbcNdK98uqrhe",
"signature": "3EC2677A896241FBFAED847A348E51EE"
]
let parameters = [
"noRef": "MAR-57521",
"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"
],
"insuredObject": [
[
"brand": "Samsung",
"type": "M20",
"imei": "12345678912345",
"price": "6000000"
],
[
"brand": "Apple",
"type": "Iphone X",
"imei": "12345678912346",
"price": "6000200"
]
],
"insuredDetail": [
"totalSumInsured": "12000200",
"package": "SAMPLEPACKAGE",
"paymentDate": "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/moveableAllRisk/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()
import http.client
conn = http.client.HTTPConnection("micro.fuse.co.id")
payload = "{\"noRef\":\"MAR-57521\",\"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\"},\"insuredObject\":[{\"brand\":\"Samsung\",\"type\":\"M20\",\"imei\":\"12345678912345\",\"price\":\"6000000\"},{\"brand\":\"Apple\",\"type\":\"Iphone X\",\"imei\":\"12345678912346\",\"price\":\"6000200\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"paymentDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}"
headers = {
'apikey': "DdfPbcNdK98uqrhe",
'signature': "3EC2677A896241FBFAED847A348E51EE"
}
conn.request("POST", "/stage-x-api/moveableAllRisk/makeOrder", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "http://micro.fuse.co.id/stage-x-api/moveableAllRisk/makeOrder"
payload := strings.NewReader("{\"noRef\":\"MAR-57521\",\"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\"},\"insuredObject\":[{\"brand\":\"Samsung\",\"type\":\"M20\",\"imei\":\"12345678912345\",\"price\":\"6000000\"},{\"brand\":\"Apple\",\"type\":\"Iphone X\",\"imei\":\"12345678912346\",\"price\":\"6000200\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"paymentDate\":\"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", "3EC2677A896241FBFAED847A348E51EE")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var http = require("http");
var options = {
"method": "POST",
"hostname": "micro.fuse.co.id",
"port": null,
"path": "/stage-x-api/moveableAllRisk/makeOrder",
"headers": {
"apikey": "DdfPbcNdK98uqrhe",
"signature": "3EC2677A896241FBFAED847A348E51EE"
}
};
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: 'MAR-57521',
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'
},
insuredObject: [
{brand: 'Samsung', type: 'M20', imei: '12345678912345', price: '6000000'},
{brand: 'Apple', type: 'Iphone X', imei: '12345678912346', price: '6000200'}
],
insuredDetail: {
totalSumInsured: '12000200',
package: 'SAMPLEPACKAGE',
paymentDate: '2019-08-02',
premium: '30000',
duration: '30'
},
callBackUrl: 'https://www.yourdomain.com/callbackapi'
}));
req.end();
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"noRef\":\"MAR-57521\",\"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\"},\"insuredObject\":[{\"brand\":\"Samsung\",\"type\":\"M20\",\"imei\":\"12345678912345\",\"price\":\"6000000\"},{\"brand\":\"Apple\",\"type\":\"Iphone X\",\"imei\":\"12345678912346\",\"price\":\"6000200\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"paymentDate\":\"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/moveableAllRisk/makeOrder")
.post(body)
.addHeader("apikey", "DdfPbcNdK98uqrhe")
.addHeader("signature", "3EC2677A896241FBFAED847A348E51EE")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("http://micro.fuse.co.id/stage-x-api/moveableAllRisk/makeOrder");
var request = new RestRequest(Method.POST);
request.AddHeader("apikey", "DdfPbcNdK98uqrhe");
request.AddHeader("signature", "3EC2677A896241FBFAED847A348E51EE");
request.AddParameter("undefined", "{\"noRef\":\"MAR-57521\",\"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\"},\"insuredObject\":[{\"brand\":\"Samsung\",\"type\":\"M20\",\"imei\":\"12345678912345\",\"price\":\"6000000\"},{\"brand\":\"Apple\",\"type\":\"Iphone X\",\"imei\":\"12345678912346\",\"price\":\"6000200\"}],\"insuredDetail\":{\"totalSumInsured\":\"12000200\",\"package\":\"SAMPLEPACKAGE\",\"paymentDate\":\"2019-08-02\",\"premium\":\"30000\",\"duration\":\"30\"},\"callBackUrl\":\"https:\\/\\/www.yourdomain.com\\/callbackapi\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);