0
我試圖使用AWS支持服務使用「創建案例」選項創建案例。我有一個Web應用程序,我想從中創建AWS支持票據。他們只是阻礙了我的立場是CORS(沒有意外:p)我的問題是,有沒有辦法讓我創建AWS
支持票據(通過發送一個ajax請求到終點)?如果是的話,那麼如何?使用ajax訪問AWS支持服務
我需要在AWS端啓用CORS支持嗎?我如何啓用它?
我曾嘗試迄今
$(function(){
$.getScript("https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.41.0/aws-sdk.js", function(data, textStatus, jqxhr) {
console.log(data); // Data returned
console.log(textStatus); // Success
console.log(jqxhr.status); // 200
console.log("Load was performed.");
alert('loaded');
var support = new AWS.Support(options = {
endpoint :'END_POINT',
accessKeyId :'SOME KEY',
secretAccessKey :'YET ANOTHER KEY'
});
var params = {
communicationBody: 'STRING_VALUE', /* required */
subject: 'STRING_VALUE', /* required */
attachmentSetId: 'STRING_VALUE',
categoryCode: 'STRING_VALUE',
ccEmailAddresses: [
'STRING_VALUE',
/* more items */
],
issueType: 'STRING_VALUE',
language: 'STRING_VALUE',
serviceCode: 'STRING_VALUE',
severityCode: 'STRING_VALUE'
};
support.createCase(params, function(err, data) {
if (err){ // an error occurred
alert('error occured');
console.log(err, err.stack);
}
else {
alert('success');
console.log(data); // successful response
}
});
});//loadScript Ends
});//document ready ends
在這方面的任何幫助深表感謝。
問候。