Chilkat Online Tools

VB.NET / Marketplacer SELLER API / Introspection

Back to Collection Items

' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

Dim http As New Chilkat.Http
Dim success As Boolean

http.BasicAuth = True
http.Login = "{{username}}"
http.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": ""
' }

Dim json As New Chilkat.JsonObject
json.UpdateString("query","query IntrospectionQuery {" & vbLf & "	__schema {" & vbLf & "		queryType {" & vbLf & "			name" & vbLf & "		}" & vbLf & "		mutationType {" & vbLf & "			name" & vbLf & "		}" & vbLf & "		subscriptionType {" & vbLf & "			name" & vbLf & "		}" & vbLf & "		types {" & vbLf & "			...FullType" & vbLf & "		}" & vbLf & "		directives {" & vbLf & "			name" & vbLf & "			description" & vbLf & "			locations" & vbLf & "			args {" & vbLf & "				...InputValue" & vbLf & "			}" & vbLf & "		}" & vbLf & "	}" & vbLf & "}" & vbLf & "fragment FullType on __Type {" & vbLf & "	kind" & vbLf & "	name" & vbLf & "	description" & vbLf & "	fields(includeDeprecated: true) {" & vbLf & "		name" & vbLf & "		description" & vbLf & "		args {" & vbLf & "			...InputValue" & vbLf & "		}" & vbLf & "		type {" & vbLf & "			...TypeRef" & vbLf & "		}" & vbLf & "		isDeprecated" & vbLf & "		deprecationReason" & vbLf & "	}" & vbLf & "	inputFields(includeDeprecated: true) {" & vbLf & "		...InputValue" & vbLf & "		isDeprecated" & vbLf & "		deprecationReason" & vbLf & "	}" & vbLf & "	interfaces {" & vbLf & "		...TypeRef" & vbLf & "	}" & vbLf & "	enumValues(includeDeprecated: true) {" & vbLf & "		name" & vbLf & "		description" & vbLf & "		isDeprecated" & vbLf & "		deprecationReason" & vbLf & "	}" & vbLf & "	possibleTypes {" & vbLf & "		...TypeRef" & vbLf & "	}" & vbLf & "}" & vbLf & "fragment InputValue on __InputValue {" & vbLf & "	name" & vbLf & "	description" & vbLf & "	type {" & vbLf & "		...TypeRef" & vbLf & "	}" & vbLf & "	defaultValue" & vbLf & "}" & vbLf & "fragment TypeRef on __Type {" & vbLf & "	kind" & vbLf & "	name" & vbLf & "	ofType {" & vbLf & "		kind" & vbLf & "		name" & vbLf & "		ofType {" & vbLf & "			kind" & vbLf & "			name" & vbLf & "			ofType {" & vbLf & "				kind" & vbLf & "				name" & vbLf & "				ofType {" & vbLf & "					kind" & vbLf & "					name" & vbLf & "					ofType {" & vbLf & "						kind" & vbLf & "						name" & vbLf & "						ofType {" & vbLf & "							kind" & vbLf & "							name" & vbLf & "							ofType {" & vbLf & "								kind" & vbLf & "								name" & vbLf & "							}" & vbLf & "						}" & vbLf & "					}" & vbLf & "				}" & vbLf & "			}" & vbLf & "		}" & vbLf & "	}" & vbLf & "}")
json.UpdateString("variables","")

http.SetRequestHeader("Content-Type","application/json")
http.SetRequestHeader("MARKETPLACER-API-KEY","{{api_key}}")

Dim resp As Chilkat.HttpResponse = http.PostJson3("https://bestfriendbazaar.com/graphql","application/json",json)
If (http.LastMethodSuccess = False) Then
    Debug.WriteLine(http.LastErrorText)
    Exit Sub
End If


Debug.WriteLine(resp.StatusCode)
Debug.WriteLine(resp.BodyStr)

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": [
  ]
}