Skip to content

vseprav/zendesk-react-native-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zendesk-react-native-api

A Zendesk API library for use with react native

Getting started

add to package.json

"zendesk-react-native-api":"git+https://github.com/vseprav/zendesk-react-native-api.git"

for local use clone repository add to package.json

"zendesk-react-native-api":"file:../zendesk-react-native-api"

Create a new API client

let config = {  
    url: 'https://{subdomain}.zendesk.com/api/v2',  
    email: '[email protected]',  
    token: 'API_TOKEN'  
  };
  
  let zendeskApi new ZenApi(config);

Tickets list

zendeskApi.tickets.list()
        .then((response) => response.json())      
        .then((responseJson) => console.log(responseJson))           
        .catch((error) => console.error(error));

Create new ticket

let ticket = {ticket: {subject: 'My printer is on fire!', comment: {body: 'The smoke is very colorful.'}}};  
zendeskApi.tickets.create(ticket)     
        .then((response) => response.json())           
        .then((responseJson) => console.log(responseJson))            
        .catch((error) => console.error(error));

About

a zendesk API library for use with react native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published