最近搜索


没有最近搜索

Colin Bennett's Avatar

Colin Bennett

已加入2022年1月20日

·

最后活动2022年1月24日

关注

0

关注者

0

活动总数

5

投票

0

订阅

1

活动概览

的最新活动 Colin Bennett

Colin Bennett 进行了评论,

社区评论 Developer - Zendesk Apps Framework (ZAF)

Hi Eric, Certainly, thank you.

查看评论 · 已于 2022年1月24日 发布 · Colin Bennett

0

关注者

0

投票

0

评论


Colin Bennett 进行了评论,

社区评论 Developer - Zendesk Apps Framework (ZAF)

Hi,

1: I've tried with the secure setting in a param file and receive the same error.

2: I receive the error when testing locally, I received a 500 error when installed as a private app.

3: Noted regarding the content type, thank you.

 

 

查看评论 · 已于 2022年1月24日 发布 · Colin Bennett

0

关注者

0

投票

0

评论


Colin Bennett 进行了评论,

社区评论 Developer - Zendesk Apps Framework (ZAF)

Hi, Please see below my Main.js and Iframe.html

Main.js

$(function() {
var client = ZAFClient.init();
client.invoke('resize', {
width: '100%',
height: '400px'
});
showForm();
$("#add-btn").click(function(event) {
event.preventDefault();
if ($("#subject").val().length < 0) {
client.invoke('notify', 'Subject can\'t be blank.', 'error');
} else {
var task = {
input_data: {
"request": {
subject: $("#subject").val(),
impact: $("#impact").val(),
Urgency: $("#urgency").val(),
subcategory: $("#subcategory").val(),
request_type: $("#request_type").val(),
mode: "zendesk"
}
}
};
sendTaskData(task, client);
}
});
});

function showForm() {
var source = $("#add_task-hdbs").html();
var template = Handlebars.compile(source);
var html = template();
$("#content").html(html);
}
var client = ZAFClient.init();
client.get('ticket.subject').then(function(subject) {
const sub = JSON.stringify(subject);
document.getElementById("subject").innerHTML = (sub.ticket.subject);
console.log(subject);
});

function sendTaskData(task, client) {
var settings = {
url: 'https://XXXX',
contentType: 'application/json;charset=utf-8',
headers: {
"Authorization": "Bearer XXXX",
"Accept": "application/vnd.manageengine.sdp.v3+json",
},
type: 'POST',
cors: false,
secure: true,
httpCompleteResponse: true,
data: JSON.stringify(task)
};
return client.request(settings).then((output) => {
const obj = JSON.parse(output);
document.getElementById("sdid").innerHTML = (obj.request.id);
console.log(output);
}).catch((error) => {
console.log("Error:", error);
});
}

Iframe.html




https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">












 

 

查看评论 · 已于 2022年1月21日 发布 · Colin Bennett

0

关注者

0

投票

0

评论


Colin Bennett 创建了一个帖子,

帖子 Developer - Zendesk Apps Framework (ZAF)

I have been guided here by Zendesk support, I am receiving the error Proxy error: {:code=>"UnprocessableEntity", :status=>"422", :title=>"Unprocessable Entity", :message=>"Failed to get installation and oauth information for app."} when I attempt to create a request to a 3rd party server, I have followed your extensive guide but still recieving the above.

已于 2022年1月20日 发布 · Colin Bennett

2

关注者

15

投票

26

评论