@Jaxom. Thank you. The issue was just a simple syntax issue. I delimited the username and password with a colon in my actual code, not a comma, a throwback to another platform. Thanks for prompting me to look at it in more detail.
Now I have got that far, I have successfully deleted a contact list, but can't get passed this, using a POST to create a list.
ListName <- paste0("\"list_name:", ListName, "\"")
CSUrl <- paste("https://rest.clicksend.com/v3/lists")
POST(CSUrl, authenticate("username","password"), body = ListName, content_type('json'))
Clearly not a REST API/cURL expert, any help would be appreciated.
ClickSend developer notes show this as the POST request for cURL. Any help to transpose to R would be great. Thanks in advance.
curl --include \
--header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \
--request POST \
--header "Content-Type: application/json" \
--data-binary " {
\"list_name\":\"ListCT3QrVL4od\"
}" \
'https://rest.clicksend.com/v3/lists'