Classic ASP / New FreshBooks / Register as a new user
Back to Collection Items
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
set http = Server.CreateObject("Chilkat_9_5_0.Http")
' Use this online tool to generate code from sample JSON: Generate Code to Create JSON
' The following JSON is sent in the request body.
' {
' "id": "api.freshbooks@gmail.com",
' "company_name": null,
' "email": "api.freshbooks@gmail.com",
' "password": "jjjjjjjjjjjjjjjjjjj",
' "country": "Canada",
' "currencyCode": "CAD",
' "access_token": null,
' "direct_buy": false,
' "skip_system": false,
' "skip_business": false,
' "send_confirmation_notification": true,
' "capacity": null,
' "provisioner": "magnum",
' "referring_url": null,
' "landing_url": null,
' "referralid": null,
' "web_promo": null,
' "visitor_id": null,
' "optimizely_user_id": "oeu1556551964423r0.989078205100306",
' "optimizely_buckets": null
' }
set json = Server.CreateObject("Chilkat_9_5_0.JsonObject")
success = json.UpdateString("id","api.freshbooks@gmail.com")
success = json.UpdateNull("company_name")
success = json.UpdateString("email","api.freshbooks@gmail.com")
success = json.UpdateString("password","jjjjjjjjjjjjjjjjjjj")
success = json.UpdateString("country","Canada")
success = json.UpdateString("currencyCode","CAD")
success = json.UpdateNull("access_token")
success = json.UpdateBool("direct_buy",0)
success = json.UpdateBool("skip_system",0)
success = json.UpdateBool("skip_business",0)
success = json.UpdateBool("send_confirmation_notification",1)
success = json.UpdateNull("capacity")
success = json.UpdateString("provisioner","magnum")
success = json.UpdateNull("referring_url")
success = json.UpdateNull("landing_url")
success = json.UpdateNull("referralid")
success = json.UpdateNull("web_promo")
success = json.UpdateNull("visitor_id")
success = json.UpdateString("optimizely_user_id","oeu1556551964423r0.989078205100306")
success = json.UpdateNull("optimizely_buckets")
http.SetRequestHeader "Content-Type","application/json"
' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.PostJson3("https://api.freshbooks.com/auth/api/v1/smux/registrations","application/json",json)
If (http.LastMethodSuccess = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( resp.StatusCode) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( resp.BodyStr) & "</pre>"
%>
</body>
</html>
Curl Command
curl -X POST
-H "Content-Type: application/json"
-d '{
"id": "api.freshbooks@gmail.com",
"company_name": null,
"email": "api.freshbooks@gmail.com",
"password": "jjjjjjjjjjjjjjjjjjj",
"country": "Canada",
"currencyCode": "CAD",
"access_token": null,
"direct_buy": false,
"skip_system": false,
"skip_business": false,
"send_confirmation_notification": true,
"capacity": null,
"provisioner": "magnum",
"referring_url": null,
"landing_url": null,
"referralid": null,
"web_promo": null,
"visitor_id": null,
"optimizely_user_id": "oeu1556551964423r0.989078205100306",
"optimizely_buckets": null
}'
https://api.freshbooks.com/auth/api/v1/smux/registrations
Postman Collection Item JSON
{
"name": "Register as a new user",
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"id\": \"api.freshbooks@gmail.com\",\n \"company_name\": null,\n \"email\": \"api.freshbooks@gmail.com\",\n \"password\": \"jjjjjjjjjjjjjjjjjjj\",\n \"country\": \"Canada\",\n \"currencyCode\": \"CAD\",\n \"access_token\": null,\n \"direct_buy\": false,\n \"skip_system\": false,\n \"skip_business\": false,\n \"send_confirmation_notification\": true,\n \"capacity\": null,\n \"provisioner\": \"magnum\",\n \"referring_url\": null,\n \"landing_url\": null,\n \"referralid\": null,\n \"web_promo\": null,\n \"visitor_id\": null,\n \"optimizely_user_id\": \"oeu1556551964423r0.989078205100306\",\n \"optimizely_buckets\": null\n}"
},
"url": {
"raw": "https://api.freshbooks.com/auth/api/v1/smux/registrations",
"protocol": "https",
"host": [
"api",
"freshbooks",
"com"
],
"path": [
"auth",
"api",
"v1",
"smux",
"registrations"
]
}
},
"response": [
]
}