Recent searches


No recent searches

how can I create an application that runs periodicall

Answered


Posted Sep 13, 2021

Hello, Zendesk developer team.
I have a question, how can I create an application that runs periodically without entering the ticket.?
Is there a tutorial?

 

1

5

5 comments

image avatar

Zach Anthony

Zendesk Product Manager

Hi David,

Depending on your use case you may be able to achieve what you're intending to do by using the Background location in Support. We don't have any specific tutorials on this but below is a quick example of some code you can use to perform an action in a background app periodically.

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script src="https://static.zdassets.com/zendesk_app_framework_sdk/2.0/zaf_sdk.min.js"></script>
<script>
const client = ZAFClient.init();

const periodicFunction = () => {
console.log('This is an action')
};

client.on('app.registered', () => {
setInterval(periodicFunction, 10000);
});
</script>
</body>
</html>
You'll just need to remember to set the location to Background in the manifest.json file
 
Hope this helps!

0


excellent it worked very well for me. You can give me the tutorial to create an app that is not in the tickets but in the top bar 

0


image avatar

Zach Anthony

Zendesk Product Manager

Hey David,

We don't have any specific tutorials for developing an app for the top bar location, however it is very similar to the process you have followed for a sidebar app. You will just need to update your manifest file to refer to the top_bar location and check the objects and events available in this location in our documentation

0


Thank you, you are helping me a lot. Finally, I would like to activate this listener when the page loads inside top_bar:
<script>
constant client = ZAFClient.init ();

periodic function const = () => {
console.log ('This is an action')
};

client.on ('app.registered', () => {
setInterval (periodicFunction, 10000);
});
</script>

Is there an event within the top bar that runs every time zendesk support loads ?.

0


image avatar

Eric Nelson

Zendesk Developer Advocacy

Hey David,

You can just use a standard 'onload' to accomplish this. This MDN documentation may be useful to you.

Have a wonderful day!

Eric Nelson | Manager - Developer Advocacy

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post