Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_Resp
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "name": "",
// "client_secret": "",
// "logo_uri": "",
// "callbacks": [
// ""
// ],
// "allowed_origins": [
// ""
// ],
// "client_aliases": [
// ""
// ],
// "allowed_clients": [
// ""
// ],
// "allowed_logout_urls": [
// ""
// ],
// "token_endpoint_auth_method": "",
// "app_type": "",
// "is_first_party": true,
// "jwt_configuration": {
// "lifetime_in_seconds": 0,
// "secret_encoded": true,
// "scopes": {},
// "alg": ""
// },
// "encryption_key": {
// "pub": "",
// "cert": ""
// },
// "sso": true,
// "custom_login_page_on": true,
// "custom_login_page": "",
// "custom_login_page_preview": "",
// "form_template": "",
// "is_heroku_app": true,
// "addons": {
// "aws": {},
// "azure_blob": {},
// "azure_sb": {},
// "rms": {},
// "mscrm": {},
// "slack": {},
// "box": {},
// "cloudbees": {},
// "concur": {},
// "dropbox": {},
// "echosign": {},
// "egnyte": {},
// "firebase": {},
// "newrelic": {},
// "office365": {},
// "salesforce": {},
// "salesforce_api": {},
// "salesforce_sandbox_api": {},
// "samlp": {},
// "layer": {},
// "sap_api": {},
// "sharepoint": {},
// "springcm": {},
// "wams": {},
// "wsfed": {},
// "zendesk": {},
// "zoom": {}
// },
// "resource_servers": [
// {
// "identifier": "",
// "scopes": [
// ""
// ]
// }
// ],
// "client_metadata": {},
// "mobile": {
// "android": {},
// "ios": {}
// }
// }
loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")
loo_Json.UpdateString("name","")
loo_Json.UpdateString("client_secret","")
loo_Json.UpdateString("logo_uri","")
loo_Json.UpdateString("callbacks[0]","")
loo_Json.UpdateString("allowed_origins[0]","")
loo_Json.UpdateString("client_aliases[0]","")
loo_Json.UpdateString("allowed_clients[0]","")
loo_Json.UpdateString("allowed_logout_urls[0]","")
loo_Json.UpdateString("token_endpoint_auth_method","")
loo_Json.UpdateString("app_type","")
loo_Json.UpdateBool("is_first_party",1)
loo_Json.UpdateInt("jwt_configuration.lifetime_in_seconds",0)
loo_Json.UpdateBool("jwt_configuration.secret_encoded",1)
loo_Json.UpdateNewObject("jwt_configuration.scopes")
loo_Json.UpdateString("jwt_configuration.alg","")
loo_Json.UpdateString("encryption_key.pub","")
loo_Json.UpdateString("encryption_key.cert","")
loo_Json.UpdateBool("sso",1)
loo_Json.UpdateBool("custom_login_page_on",1)
loo_Json.UpdateString("custom_login_page","")
loo_Json.UpdateString("custom_login_page_preview","")
loo_Json.UpdateString("form_template","")
loo_Json.UpdateBool("is_heroku_app",1)
loo_Json.UpdateNewObject("addons.aws")
loo_Json.UpdateNewObject("addons.azure_blob")
loo_Json.UpdateNewObject("addons.azure_sb")
loo_Json.UpdateNewObject("addons.rms")
loo_Json.UpdateNewObject("addons.mscrm")
loo_Json.UpdateNewObject("addons.slack")
loo_Json.UpdateNewObject("addons.box")
loo_Json.UpdateNewObject("addons.cloudbees")
loo_Json.UpdateNewObject("addons.concur")
loo_Json.UpdateNewObject("addons.dropbox")
loo_Json.UpdateNewObject("addons.echosign")
loo_Json.UpdateNewObject("addons.egnyte")
loo_Json.UpdateNewObject("addons.firebase")
loo_Json.UpdateNewObject("addons.newrelic")
loo_Json.UpdateNewObject("addons.office365")
loo_Json.UpdateNewObject("addons.salesforce")
loo_Json.UpdateNewObject("addons.salesforce_api")
loo_Json.UpdateNewObject("addons.salesforce_sandbox_api")
loo_Json.UpdateNewObject("addons.samlp")
loo_Json.UpdateNewObject("addons.layer")
loo_Json.UpdateNewObject("addons.sap_api")
loo_Json.UpdateNewObject("addons.sharepoint")
loo_Json.UpdateNewObject("addons.springcm")
loo_Json.UpdateNewObject("addons.wams")
loo_Json.UpdateNewObject("addons.wsfed")
loo_Json.UpdateNewObject("addons.zendesk")
loo_Json.UpdateNewObject("addons.zoom")
loo_Json.UpdateString("resource_servers[0].identifier","")
loo_Json.UpdateString("resource_servers[0].scopes[0]","")
loo_Json.UpdateNewObject("client_metadata")
loo_Json.UpdateNewObject("mobile.android")
loo_Json.UpdateNewObject("mobile.ios")
// Adds the "Authorization: Bearer {{auth0_token}}" header.
loo_Http.AuthToken = "{{auth0_token}}"
loo_Http.SetRequestHeader("Content-Type","application/json")
loo_Resp = loo_Http.PostJson3("https://{{auth0_domain}}/api/v2/clients","application/json",loo_Json)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_Json
return
end if
Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp
destroy loo_Http
destroy loo_Json
Curl Command
curl -X POST
-H "Authorization: Bearer {{auth0_token}}"
-H "Content-Type: application/json"
-d '{
"name": "",
"client_secret": "",
"logo_uri": "",
"callbacks": [
""
],
"allowed_origins": [
""
],
"client_aliases": [
""
],
"allowed_clients": [
""
],
"allowed_logout_urls": [
""
],
"token_endpoint_auth_method": "",
"app_type": "",
"is_first_party": true,
"jwt_configuration": {
"lifetime_in_seconds": 0,
"secret_encoded": true,
"scopes": {},
"alg": ""
},
"encryption_key": {
"pub": "",
"cert": ""
},
"sso": true,
"custom_login_page_on": true,
"custom_login_page": "",
"custom_login_page_preview": "",
"form_template": "",
"is_heroku_app": true,
"addons": {
"aws": {},
"azure_blob": {},
"azure_sb": {},
"rms": {},
"mscrm": {},
"slack": {},
"box": {},
"cloudbees": {},
"concur": {},
"dropbox": {},
"echosign": {},
"egnyte": {},
"firebase": {},
"newrelic": {},
"office365": {},
"salesforce": {},
"salesforce_api": {},
"salesforce_sandbox_api": {},
"samlp": {},
"layer": {},
"sap_api": {},
"sharepoint": {},
"springcm": {},
"wams": {},
"wsfed": {},
"zendesk": {},
"zoom": {}
},
"resource_servers": [
{
"identifier": "",
"scopes": [
""
]
}
],
"client_metadata": {},
"mobile": {
"android": {},
"ios": {}
}
}'
https://{{auth0_domain}}/api/v2/clients
Postman Collection Item JSON
{
"name": "Create a client",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"\",\r\n \"client_secret\": \"\",\r\n \"logo_uri\": \"\",\r\n \"callbacks\": [\r\n \"\"\r\n ],\r\n \"allowed_origins\": [\r\n \"\"\r\n ],\r\n \"client_aliases\": [\r\n \"\"\r\n ],\r\n \"allowed_clients\": [\r\n \"\"\r\n ],\r\n \"allowed_logout_urls\": [\r\n \"\"\r\n ],\r\n \"token_endpoint_auth_method\": \"\",\r\n \"app_type\": \"\",\r\n \"is_first_party\": true,\r\n \"jwt_configuration\": {\r\n \"lifetime_in_seconds\": 0,\r\n \"secret_encoded\": true,\r\n \"scopes\": {},\r\n \"alg\": \"\"\r\n },\r\n \"encryption_key\": {\r\n \"pub\": \"\",\r\n \"cert\": \"\"\r\n },\r\n \"sso\": true,\r\n \"custom_login_page_on\": true,\r\n \"custom_login_page\": \"\",\r\n \"custom_login_page_preview\": \"\",\r\n \"form_template\": \"\",\r\n \"is_heroku_app\": true,\r\n \"addons\": {\r\n \"aws\": {},\r\n \"azure_blob\": {},\r\n \"azure_sb\": {},\r\n \"rms\": {},\r\n \"mscrm\": {},\r\n \"slack\": {},\r\n \"box\": {},\r\n \"cloudbees\": {},\r\n \"concur\": {},\r\n \"dropbox\": {},\r\n \"echosign\": {},\r\n \"egnyte\": {},\r\n \"firebase\": {},\r\n \"newrelic\": {},\r\n \"office365\": {},\r\n \"salesforce\": {},\r\n \"salesforce_api\": {},\r\n \"salesforce_sandbox_api\": {},\r\n \"samlp\": {},\r\n \"layer\": {},\r\n \"sap_api\": {},\r\n \"sharepoint\": {},\r\n \"springcm\": {},\r\n \"wams\": {},\r\n \"wsfed\": {},\r\n \"zendesk\": {},\r\n \"zoom\": {}\r\n },\r\n \"resource_servers\": [\r\n {\r\n \"identifier\": \"\",\r\n \"scopes\": [\r\n \"\"\r\n ]\r\n }\r\n ],\r\n \"client_metadata\": {},\r\n \"mobile\": {\r\n \"android\": {},\r\n \"ios\": {}\r\n }\r\n}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/clients",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"clients"
]
},
"description": "Creates a new client application. The samples on the right show every attribute that can be used."
},
"response": [
]
}