Back to Collection Items
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess
$oHttp.BasicAuth = True
$oHttp.Login = "{{username}}"
$oHttp.Password = "{{password}}"
; Use this online tool to generate code from sample JSON: Generate Code to Create JSON
; The following JSON is sent in the request body.
; {
; "query": "query IntrospectionQuery {\n\t__schema {\n\t\tqueryType {\n\t\t\tname\n\t\t}\n\t\tmutationType {\n\t\t\tname\n\t\t}\n\t\tsubscriptionType {\n\t\t\tname\n\t\t}\n\t\ttypes {\n\t\t\t...FullType\n\t\t}\n\t\tdirectives {\n\t\t\tname\n\t\t\tdescription\n\t\t\tlocations\n\t\t\targs {\n\t\t\t\t...InputValue\n\t\t\t}\n\t\t}\n\t}\n}\nfragment FullType on __Type {\n\tkind\n\tname\n\tdescription\n\tfields(includeDeprecated: true) {\n\t\tname\n\t\tdescription\n\t\targs {\n\t\t\t...InputValue\n\t\t}\n\t\ttype {\n\t\t\t...TypeRef\n\t\t}\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tinputFields(includeDeprecated: true) {\n\t\t...InputValue\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tinterfaces {\n\t\t...TypeRef\n\t}\n\tenumValues(includeDeprecated: true) {\n\t\tname\n\t\tdescription\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tpossibleTypes {\n\t\t...TypeRef\n\t}\n}\nfragment InputValue on __InputValue {\n\tname\n\tdescription\n\ttype {\n\t\t...TypeRef\n\t}\n\tdefaultValue\n}\nfragment TypeRef on __Type {\n\tkind\n\tname\n\tofType {\n\t\tkind\n\t\tname\n\t\tofType {\n\t\t\tkind\n\t\t\tname\n\t\t\tofType {\n\t\t\t\tkind\n\t\t\t\tname\n\t\t\t\tofType {\n\t\t\t\t\tkind\n\t\t\t\t\tname\n\t\t\t\t\tofType {\n\t\t\t\t\t\tkind\n\t\t\t\t\t\tname\n\t\t\t\t\t\tofType {\n\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\tofType {\n\t\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
; "variables": ""
; }
$oJson = ObjCreate("Chilkat.JsonObject")
$oJson.UpdateString("query","query IntrospectionQuery {" & @LF & " __schema {" & @LF & " queryType {" & @LF & " name" & @LF & " }" & @LF & " mutationType {" & @LF & " name" & @LF & " }" & @LF & " subscriptionType {" & @LF & " name" & @LF & " }" & @LF & " types {" & @LF & " ...FullType" & @LF & " }" & @LF & " directives {" & @LF & " name" & @LF & " description" & @LF & " locations" & @LF & " args {" & @LF & " ...InputValue" & @LF & " }" & @LF & " }" & @LF & " }" & @LF & "}" & @LF & "fragment FullType on __Type {" & @LF & " kind" & @LF & " name" & @LF & " description" & @LF & " fields(includeDeprecated: true) {" & @LF & " name" & @LF & " description" & @LF & " args {" & @LF & " ...InputValue" & @LF & " }" & @LF & " type {" & @LF & " ...TypeRef" & @LF & " }" & @LF & " isDeprecated" & @LF & " deprecationReason" & @LF & " }" & @LF & " inputFields(includeDeprecated: true) {" & @LF & " ...InputValue" & @LF & " isDeprecated" & @LF & " deprecationReason" & @LF & " }" & @LF & " interfaces {" & @LF & " ...TypeRef" & @LF & " }" & @LF & " enumValues(includeDeprecated: true) {" & @LF & " name" & @LF & " description" & @LF & " isDeprecated" & @LF & " deprecationReason" & @LF & " }" & @LF & " possibleTypes {" & @LF & " ...TypeRef" & @LF & " }" & @LF & "}" & @LF & "fragment InputValue on __InputValue {" & @LF & " name" & @LF & " description" & @LF & " type {" & @LF & " ...TypeRef" & @LF & " }" & @LF & " defaultValue" & @LF & "}" & @LF & "fragment TypeRef on __Type {" & @LF & " kind" & @LF & " name" & @LF & " ofType {" & @LF & " kind" & @LF & " name" & @LF & " ofType {" & @LF & " kind" & @LF & " name" & @LF & " ofType {" & @LF & " kind" & @LF & " name" & @LF & " ofType {" & @LF & " kind" & @LF & " name" & @LF & " ofType {" & @LF & " kind" & @LF & " name" & @LF & " ofType {" & @LF & " kind" & @LF & " name" & @LF & " ofType {" & @LF & " kind" & @LF & " name" & @LF & " }" & @LF & " }" & @LF & " }" & @LF & " }" & @LF & " }" & @LF & " }" & @LF & " }" & @LF & "}")
$oJson.UpdateString("variables","")
$oHttp.SetRequestHeader "Content-Type","application/json"
$oHttp.SetRequestHeader "MARKETPLACER-API-KEY","{{api_key}}"
Local $oResp = $oHttp.PostJson3("https://bestfriendbazaar.com/graphql","application/json",$oJson)
If ($oHttp.LastMethodSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite($oResp.StatusCode & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)
Curl Command
curl -X POST
-u '{{username}}:{{password}}'
-H "MARKETPLACER-API-KEY: {{api_key}}"
-H "Content-Type: application/json"
--data-raw '{"query":"query IntrospectionQuery {\n\t__schema {\n\t\tqueryType {\n\t\t\tname\n\t\t}\n\t\tmutationType {\n\t\t\tname\n\t\t}\n\t\tsubscriptionType {\n\t\t\tname\n\t\t}\n\t\ttypes {\n\t\t\t...FullType\n\t\t}\n\t\tdirectives {\n\t\t\tname\n\t\t\tdescription\n\t\t\tlocations\n\t\t\targs {\n\t\t\t\t...InputValue\n\t\t\t}\n\t\t}\n\t}\n}\nfragment FullType on __Type {\n\tkind\n\tname\n\tdescription\n\tfields(includeDeprecated: true) {\n\t\tname\n\t\tdescription\n\t\targs {\n\t\t\t...InputValue\n\t\t}\n\t\ttype {\n\t\t\t...TypeRef\n\t\t}\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tinputFields(includeDeprecated: true) {\n\t\t...InputValue\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tinterfaces {\n\t\t...TypeRef\n\t}\n\tenumValues(includeDeprecated: true) {\n\t\tname\n\t\tdescription\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tpossibleTypes {\n\t\t...TypeRef\n\t}\n}\nfragment InputValue on __InputValue {\n\tname\n\tdescription\n\ttype {\n\t\t...TypeRef\n\t}\n\tdefaultValue\n}\nfragment TypeRef on __Type {\n\tkind\n\tname\n\tofType {\n\t\tkind\n\t\tname\n\t\tofType {\n\t\t\tkind\n\t\t\tname\n\t\t\tofType {\n\t\t\t\tkind\n\t\t\t\tname\n\t\t\t\tofType {\n\t\t\t\t\tkind\n\t\t\t\t\tname\n\t\t\t\t\tofType {\n\t\t\t\t\t\tkind\n\t\t\t\t\t\tname\n\t\t\t\t\t\tofType {\n\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\tofType {\n\t\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","variables":""}'
https://bestfriendbazaar.com/graphql
Postman Collection Item JSON
{
"name": "Introspection",
"request": {
"method": "POST",
"header": [
{
"key": "MARKETPLACER-API-KEY",
"value": "{{api_key}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "graphql",
"graphql": {
"query": "query IntrospectionQuery {\n\t__schema {\n\t\tqueryType {\n\t\t\tname\n\t\t}\n\t\tmutationType {\n\t\t\tname\n\t\t}\n\t\tsubscriptionType {\n\t\t\tname\n\t\t}\n\t\ttypes {\n\t\t\t...FullType\n\t\t}\n\t\tdirectives {\n\t\t\tname\n\t\t\tdescription\n\t\t\tlocations\n\t\t\targs {\n\t\t\t\t...InputValue\n\t\t\t}\n\t\t}\n\t}\n}\nfragment FullType on __Type {\n\tkind\n\tname\n\tdescription\n\tfields(includeDeprecated: true) {\n\t\tname\n\t\tdescription\n\t\targs {\n\t\t\t...InputValue\n\t\t}\n\t\ttype {\n\t\t\t...TypeRef\n\t\t}\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tinputFields(includeDeprecated: true) {\n\t\t...InputValue\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tinterfaces {\n\t\t...TypeRef\n\t}\n\tenumValues(includeDeprecated: true) {\n\t\tname\n\t\tdescription\n\t\tisDeprecated\n\t\tdeprecationReason\n\t}\n\tpossibleTypes {\n\t\t...TypeRef\n\t}\n}\nfragment InputValue on __InputValue {\n\tname\n\tdescription\n\ttype {\n\t\t...TypeRef\n\t}\n\tdefaultValue\n}\nfragment TypeRef on __Type {\n\tkind\n\tname\n\tofType {\n\t\tkind\n\t\tname\n\t\tofType {\n\t\t\tkind\n\t\t\tname\n\t\t\tofType {\n\t\t\t\tkind\n\t\t\t\tname\n\t\t\t\tofType {\n\t\t\t\t\tkind\n\t\t\t\t\tname\n\t\t\t\t\tofType {\n\t\t\t\t\t\tkind\n\t\t\t\t\t\tname\n\t\t\t\t\t\tofType {\n\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\tofType {\n\t\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"variables": ""
}
},
"url": {
"raw": "{{base_url}}",
"host": [
"{{base_url}}"
],
"path": null
},
"description": null
},
"response": [
]
}