##Example: Creating a user when the phone number must be valid *See Documentation
URL:
POST /api/v2/users.json
| (function() { | |
| return { | |
| events: { | |
| 'app.activated':'init' | |
| }, | |
| init: function() { | |
| var self = this; |
| import json | |
| import requests | |
| import math | |
| config = { | |
| "subdomain": "", ## Your Zendesk subdomain | |
| "admin_user": "", ## An Administrator user's email | |
| "token": "" ## Your Zednesk API token | |
| } |
| <html> | |
| <head> | |
| <link href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> | |
| </head> | |
| <body> | |
| <select id="selectId"> | |
| <option>111</option> | |
| <option>222</option> |
| (function() { | |
| return { | |
| events: { | |
| 'app.activated': 'init', | |
| 'ticket.requester.id.changed': 'onRequesterChanged' | |
| }, | |
| init: function() { |
| # This script assumes you have instantiated a ZendeskAPI::Client and assigned it to 'client' | |
| ticket = client.tickets.find(:id => 4060) | |
| comments = ticket.comments.fetch | |
| # Iterate over comments and show comment value and value for the 'public' attribute (using example json public comments are 'bar' and private are 'foo') | |
| comments.each do |c| | |
| puts "the comment value is #{c.body}" | |
| puts "the comments 'public' attribute is #{c.public}" | |
| end;nil |
| test = client.organization_fields.find(:id => 132127) | |
| old_options = test.custom_field_options | |
| old_options << {"id"=>nil,"name"=>"newname2","value"=>"newvalue2"} | |
| test.custom_field_options = [] | |
| test.changed? | |
| #returns true at this point | |
| test.custom_field_options = old_options | |
| test.save |
##Example: Creating a user when the phone number must be valid *See Documentation
URL:
POST /api/v2/users.json
| <aside class="article-sidebar side-column"> | |
| {{recent_articles}} | |
| <!-- BEGIN CUSTOM SECTION FOR ARTICLES RELATED BY LABEL --> | |
| <section class="articles-related" id="label_related"> | |
| <h3>Related articles</h3> | |
| <img id="label_rel_spinner" src="//p5.zdassets.com/hc/theme_assets/413487/200013043/loading.gif"/> <!-- You get this URL after uploading the loading.gif to assets --> | |
| <!-- source image uploaded to imgur here - http://i.imgur.com/JPrUDDz.gifv --> | |
| </section> |
| import requests | |
| import json | |
| SUBDOMAIN = 'SUBDOMAIN' | |
| s = requests.Session() | |
| s.auth = ('email@domain/token','VERYSECRETAPITOKEN') | |
| def upload_attachment(article_id, path): |