HTTP methods
The Sitecore Send API uses the following standard HTTP methods for indicating the action to take on available resources:
-
GET
- you can use this method to retrieve data from your account in our system. When you make aGET
request, all request parameters are added to the request URL, in a format specific to the API call.RequestResponsecurl --include \ 'https://{hostname}/v3/campaigns.{Format}?apikey='
-
DELETE
- you can use this method to remove information from your account.RequestResponsecurl --include \ --request DELETE \ 'https://{hostname}/v3/campaigns/{CampaignID}/delete.{Format}?apikey='
-
POST
- you can use this method to send data to our system to modify data in your account. When you make aPOST
request, the request URL usually contains the response format and authentication, and the request stream contains hypothetical parameters forName
,Subject
,SenderEmail
,WebLocation
, andMailingListID
:RequestResponsecurl --include \ --request POST \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data-binary "{ \"Name\":\"Test campaign\", \"Subject\":\"Some subject\", \"SenderEmail\":\"[email protected]\", \"ReplyToEmail\":\"[email protected]\", \"ConfirmationToEmail\":\"[email protected]\", \"HTMLContent\":\"Some HTML body\", \"MailingLists\": [ { \"MailingListID\":\"adaf2fe1-55db-42dc-aaf8-56d8f502138d\", \"SegmentID\":\"10166\" }, { \"MailingListID\":\"dce99b7a-2619-4805-aaeb-7fecdcb3c71b\" } ], \"IsAB\":\"true\", \"ABCampaignType\":\"Content\", \"WebLocationB\":\"http://www.mysite.gr/newsletter/index\", \"HoursToTest\":\"2\", \"ListPercentage\":\"20\", \"ABWinnerSelectionType\":\"OpenRate\" }" \ 'https://{hostname}/v3/campaigns/create.{Format}?apikey='