Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Swift 3,4,5... Web API Examples

Primary Categories

ABN AMRO
AWS Translate
Activix CRM
Adyen
Amazon DynamoDB
Amazon MWS
Amazon Rekognition
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bitfinex v2 REST
Bluzone
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
ETrade
Egypt ITIDA
Etsy
Facebook
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
MercadoLibre

Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Okta OAuth/OIDC
OneLogin OIDC
OneNote
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
Trello
Twilio
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yousign
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(Swift 3,4,5...) Microsoft Teams - Create Team (minimal request)

The following is an example of a minimal request to create a Team. By omitting other properties, the client is implicitly taking defaults from the pre-defined template represented by template.

For more information, see https://docs.microsoft.com/en-us/graph/api/team-post?view=graph-rest-1.0&tabs=http#request

Chilkat Downloads for the Swift Programming Language

MAC OS X (Cocoa) Objective-C/Swift Libs

iOS Objective-C/Swift Libs

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

    let http = CkoHttp()!
    var success: Bool

    // To create a Microsoft Team, we want to send an HTTP request like the following:

    // POST https://graph.microsoft.com/v1.0/teams
    // Content-Type: application/json
    // 
    // {
    //   "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
    //   "displayName": "My Sample Team",
    //   "description": "My Sample Team’s Description"
    // }

    let json = CkoJsonObject()!
    json.update("\"template@odata.bind\"", value: "https://graph.microsoft.com/v1.0/teamsTemplates('standard')")
    json.update("displayName", value: "My Sample Team")
    json.update("description", value: "My Sample Team’s Description")

    http.setRequestHeader("Content-type", value: "application/json")

    // Adds the "Authorization: Bearer ACCESS_TOKEN" header.
    http.authToken = "ACCESS_TOKEN"

    var resp: CkoHttpResponse? = http.postJson3("https://graph.microsoft.com/v1.0/teams", contentType: "application/json", json: json)
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    // A successful response is indicated by a 202 response status code and an empty response body.
    print("Response Status Code: \(resp!.statusCode.intValue)")
    print("Response Body:")
    print("\(resp!.bodyStr!)")

    if resp!.statusCode.intValue >= 400 {
        print("Response Header:")
        print("\(resp!.header!)")
        print("Failed.")
    }

    resp = nil

}

 

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