Assign to an entity
1 min
POST
https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/assign
Path Parameters
- clientIdstringrequiredDescription
- folderIdinteger<int64>requiredDescriptionFormatint64
Form Parameters
- entityIdinteger<int64>requiredDescriptionFormatint64
Responses
200
400
404
409
curl
curl --request POST \
--url https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/assign \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'entityId=integer<int64>'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("entityId", "integer<int64>");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/assign", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "net/http"
url = URI("https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/assign")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/x-www-form-urlencoded"
request.body = "entityId=integer%3Cint64%3E"
response = https.request(request)
puts response.read_body
python
import requests
url = "https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/assign"
payload = 'entityId=integer%3Cint64%3E'
headers = {
'accept': 'application/json',
'content-type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// The entity was assigned successfully.
400
// The entity ID is required. Check for the ID of the entity and add it to the request.
404
// The folder or entity object could not be found. Ensure that the required parameters such as "folderId" or "entityID" are correct and the folder exists.
409
// The folder could not be assigned to the mailing entity because the entity is a campaign child. Ensure that the requested entity is not a child of a campaign.