Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

.NET Core C# Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois
Mastercard

MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(.NET Core C#) IntakeQ: Send a Questionnaire

See more IntakeQ Examples

Send an intake package using the API.

For more information, see https://support.intakeq.com/article/31-intakeq-api#send-questionnaire

Chilkat .NET Downloads

Chilkat .NET Assemblies

Chilkat for .NET Core

Chilkat for Mono

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

Chilkat.Http http = new Chilkat.Http();
bool success;

// Implements the following CURL command:

// curl -H "Content-Type: application/json" \
//      -H 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxxx' \
//      -X POST \
//      -d '{     		
// 	"QuestionnaireId": "00000000-0000-0000-0000-000000000000",     		
// 	"ClientId": 123, 
// 	"ClientName": "Dexter Morgan",
// 	"ClientEmail": "dexter@email.com",
// 	"ClientPhone": "2222222222", 
// 	"PractitionerId": "00000000-0000-0000-0000-000000000000",
// }' https://intakeq.com/api/v1/intakes/send

// Use the following online tool to generate HTTP code from a CURL command
// Convert a cURL Command to HTTP Source Code

// Use this online tool to generate code from sample JSON:
// Generate Code to Create JSON

// The following JSON is sent in the request body.

// {
//   "QuestionnaireId": "00000000-0000-0000-0000-000000000000",
//   "ClientId": 123,
//   "ClientName": "Dexter Morgan",
//   "ClientEmail": "dexter@email.com",
//   "ClientPhone": "2222222222",
//   "PractitionerId": "00000000-0000-0000-0000-000000000000"
// }

Chilkat.JsonObject json = new Chilkat.JsonObject();
json.UpdateString("QuestionnaireId","00000000-0000-0000-0000-000000000000");
json.UpdateInt("ClientId",123);
json.UpdateString("ClientName","Dexter Morgan");
json.UpdateString("ClientEmail","dexter@email.com");
json.UpdateString("ClientPhone","2222222222");
json.UpdateString("PractitionerId","00000000-0000-0000-0000-000000000000");

http.SetRequestHeader("Content-Type","application/json");
http.SetRequestHeader("X-Auth-Key","xxxxxxxxxxxxxxxxxxxxxxxxx");

Chilkat.HttpResponse resp = http.PostJson3("https://intakeq.com/api/v1/intakes/send","application/json",json);
if (http.LastMethodSuccess == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
resp.GetBodySb(sbResponseBody);
Chilkat.JsonObject jResp = new Chilkat.JsonObject();
jResp.LoadSb(sbResponseBody);
jResp.EmitCompact = false;

Debug.WriteLine("Response Body:");
Debug.WriteLine(jResp.Emit());

int respStatusCode = resp.StatusCode;
Debug.WriteLine("Response Status Code = " + Convert.ToString(respStatusCode));
if (respStatusCode >= 400) {
    Debug.WriteLine("Response Header:");
    Debug.WriteLine(resp.Header);
    Debug.WriteLine("Failed.");

    return;
}

// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)

// {
//   "Id": "00000000-0000-0000-0000-000000000000",
//   "ClientName": "test",
//   "ClientEmail": "test@email.com",
//   "ClientId": 9999,
//   "Status": "Completed",
//   "DateCreated": 1458526480368,
//   "DateSubmitted": 1458526532654,
//   "QuestionnaireName": "test",
//   "Practitioner": "test@email.com",
//   "PractitionerName": "FirstName LastName",
//   "Questions": [
//     {
//       "Id": "xxxx-1",
//       "Text": "Full name",
//       "Answer": "Dexter Morgan",
//       "QuestionType": "OpenQuestion",
//       "Rows": [
//       ],
//       "ColumnNames": [
//       ],
//       "OfficeUse": false,
//       "OfficeNote": "aaa"
//     },
//     {
//       "Id": "xxxx-2",
//       "Text": "Full name",
//       "Answer": "Dexter Morgan",
//       "QuestionType": "OpenQuestion",
//       "Rows": [
//       ],
//       "ColumnNames": [
//       ],
//       "OfficeUse": false,
//       "OfficeNote": "aaa"
//     }
//   ],
//   "AppointmentId": "xxxxxxxx",
//   "ConsentForms": [
//     {
//       "Id": "00000000-0000-0000-0000-000000000000",
//       "Name": "HIPAA Release Form",
//       "DocumentType": "Html",
//       "Signed": true,
//       "DateSubmitted": 1458526532654
//     }
//   ]
// }

// Sample code for parsing the JSON response...
// Use the following online tool to generate parsing code from sample JSON:
// Generate Parsing Code from JSON

string Text;
string Answer;
string QuestionType;
bool OfficeUse;
string OfficeNote;
int j;
int count_j;
string Name;
string DocumentType;
bool Signed;

string Id = jResp.StringOf("Id");
string ClientName = jResp.StringOf("ClientName");
string ClientEmail = jResp.StringOf("ClientEmail");
int ClientId = jResp.IntOf("ClientId");
string Status = jResp.StringOf("Status");
int DateCreated = jResp.IntOf("DateCreated");
int DateSubmitted = jResp.IntOf("DateSubmitted");
string QuestionnaireName = jResp.StringOf("QuestionnaireName");
string Practitioner = jResp.StringOf("Practitioner");
string PractitionerName = jResp.StringOf("PractitionerName");
string AppointmentId = jResp.StringOf("AppointmentId");
int i = 0;
int count_i = jResp.SizeOfArray("Questions");
while (i < count_i) {
    jResp.I = i;
    Id = jResp.StringOf("Questions[i].Id");
    Text = jResp.StringOf("Questions[i].Text");
    Answer = jResp.StringOf("Questions[i].Answer");
    QuestionType = jResp.StringOf("Questions[i].QuestionType");
    OfficeUse = jResp.BoolOf("Questions[i].OfficeUse");
    OfficeNote = jResp.StringOf("Questions[i].OfficeNote");
    j = 0;
    count_j = jResp.SizeOfArray("Questions[i].Rows");
    while (j < count_j) {
        jResp.J = j;
        j = j + 1;
    }

    j = 0;
    count_j = jResp.SizeOfArray("Questions[i].ColumnNames");
    while (j < count_j) {
        jResp.J = j;
        j = j + 1;
    }

    i = i + 1;
}

i = 0;
count_i = jResp.SizeOfArray("ConsentForms");
while (i < count_i) {
    jResp.I = i;
    Id = jResp.StringOf("ConsentForms[i].Id");
    Name = jResp.StringOf("ConsentForms[i].Name");
    DocumentType = jResp.StringOf("ConsentForms[i].DocumentType");
    Signed = jResp.BoolOf("ConsentForms[i].Signed");
    DateSubmitted = jResp.IntOf("ConsentForms[i].DateSubmitted");
    i = i + 1;
}


 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.