/// <summary> /// This end-point is for bulk importing tickets. It will allow you to /// move data from legacy systems into Zendesk. We do not run triggers /// or the likes during bulk imports like these. /// </summary> public IndividualTicketResponse Import(TicketImport ticket) { var body = new {ticket}; return GenericPost<IndividualTicketResponse>( String.Format("imports/{0}.json", _tickets), body); }
/// <summary> /// UpdateTicket a ticket or add comments to it. Keep in mind that somethings like the description can't be updated. /// </summary> /// <param name="ticket"></param> /// <param name="comment"></param> /// <returns></returns> public IndividualTicketResponse UpdateTicket(Ticket ticket, Comment comment=null) { if (comment != null) ticket.Comment = comment; var body = new { ticket }; return GenericPut<IndividualTicketResponse>(string.Format("{0}/{1}.json", _tickets, ticket.Id), body); }
public IndividualTicketFieldResponse CreateTicketField(TicketField ticketField) { var body = new { ticket_field = new { type = ticketField.Type, title = ticketField.Title } }; var res = GenericPost<IndividualTicketFieldResponse>("ticket_fields.json", body); return res; }
public async Task<bool> ChangeUsersPasswordAsync(long userId, string oldPassword, string newPassword) { var body = new { previous_password = oldPassword, password = newPassword }; return await GenericBoolPostAsync(string.Format("users/{0}/password.json", userId), body); }
public async Task<IndividualUserResponse> SuspendUserAsync(long id) { var body = new {user = new {suspended = true}}; return await GenericPutAsync<IndividualUserResponse>(string.Format("users/{0}.json", id), body); }
public async Task<IndividualUserResponse> CreateUserAsync(User user) { var body = new { user = user }; return await GenericPostAsync<IndividualUserResponse>("users.json", body); }
public IndividualUserIdentityResponse UpdateUserIdentity(long userId, UserIdentity identity) { var body = new { identity }; return GenericPost<IndividualUserIdentityResponse>(string.Format("users/{0}/identities.json", userId), body); }
public bool SetUsersPassword(long userId, string newPassword) { var body = new {password = newPassword}; return GenericBoolPost(string.Format("users/{0}/password.json", userId), body); }
public IndividualUserResponse SuspendUser(long id) { var body = new {user = new {suspended = true}}; return GenericPut<IndividualUserResponse>(string.Format("users/{0}.json", id), body); }
public bool ReorderTicketForms(long[] orderedTicketFormIds) { var body = new { ticket_form_ids = orderedTicketFormIds }; return GenericPut<bool>(string.Format("{0}/reorder.json", _ticket_forms), body); }
public async Task<bool> ReorderTicketFormsAsync(long[] orderedTicketFormIds) { var body = new { ticket_form_ids = orderedTicketFormIds }; return await GenericPutAsync<bool>(string.Format("{0}/reorder.json", _ticket_forms), body); }
public async Task<IndividualTicketFormResponse> CreateTicketFormAsync(TicketForm ticketForm) { var body = new { ticket_form = ticketForm }; return await GenericPostAsync<IndividualTicketFormResponse>(_ticket_forms + ".json", body); }
public IndividualTicketFormResponse UpdateTicketForm(TicketForm ticketForm) { var body = new { ticket_form = ticketForm}; return GenericPut<IndividualTicketFormResponse>(string.Format("{0}/{1}.json", _ticket_forms, ticketForm.Id), body); }
public IndividualTicketFormResponse CreateTicketForm(TicketForm ticketForm) { var body = new { ticket_form = ticketForm }; return GenericPost<IndividualTicketFormResponse>(_ticket_forms + ".json", body); }
public IndividualTicketFieldResponse UpdateTicketField(TicketField ticketField) { var body = new { ticket_field = ticketField }; return GenericPut<IndividualTicketFieldResponse>(string.Format("ticket_fields/{0}.json", ticketField.Id), body); }
public IndividualUserResponse CreateUser(User user) { var body = new { user = user }; return GenericPost<IndividualUserResponse>("users.json", body); }
public JobStatusResponse BulkCreateUsers(IEnumerable<User> users) { var body = new {users = users}; return GenericPost<JobStatusResponse>("users/create_many.json", body); }
public async Task<IndividualTicketResponse> CreateTicketAsync(Ticket ticket) { var body = new {ticket}; return await GenericPostAsync<IndividualTicketResponse>(_tickets + ".json", body); }
public IndividualUserResponse UpdateUser(User user) { var body = new { user = user }; return GenericPut<IndividualUserResponse>(string.Format("users/{0}.json", user.Id), body); }
/// <summary> /// UpdateTicket a ticket or add comments to it. Keep in mind that somethings like the description can't be updated. /// </summary> /// <param name="ticket"></param> /// <param name="comment"></param> /// <returns></returns> public async Task<IndividualTicketResponse> UpdateTicketAsync(Ticket ticket, Comment comment=null) { if (comment != null) ticket.Comment = comment; var body = new { ticket }; return await GenericPutAsync<IndividualTicketResponse>(string.Format("{0}/{1}.json", _tickets, ticket.Id), body); }
public bool ChangeUsersPassword(long userId, string oldPassword, string newPassword) { var body = new { previous_password = oldPassword, password = newPassword }; return GenericBoolPost(string.Format("users/{0}/password.json", userId), body); }
public async Task<JobStatusResponse> BulkUpdateAsync(List<long> ids, BulkUpdate info) { var body = new { ticket = info }; return await GenericPutAsync<JobStatusResponse>(string.Format("{0}/update_many.json?ids={1}", _tickets, ids.ToCsv()), body); }
/// <summary> /// The user whose id is provided in the URL will be merged into the existing user provided in the params. Any two arbitrary users can be merged. /// </summary> /// <param name="fromId"></param> /// <param name="intoId"></param> /// <returns></returns> public async Task<IndividualUserResponse> MergeUserAsync(long fromId, long intoId) { var body = new { user = new { id = intoId } }; return await GenericPutAsync<IndividualUserResponse>(string.Format("users/{0}/merge.json", fromId), body); }
public async Task<IndividualTicketFieldResponse> CreateTicketFieldAsync(TicketField ticketField) { var body = new { ticket_field = new { type = ticketField.Type, title = ticketField.Title } }; var res = GenericPostAsync<IndividualTicketFieldResponse>("ticket_fields.json", body); return await res; }
public async Task<JobStatusResponse> BulkCreateUsersAsync(IEnumerable<User> users) { var body = new {users = users}; return await GenericPostAsync<JobStatusResponse>("users/create_many.json", body); }
public IndividualTicketResponse CreateTicket(Ticket ticket) { var body = new {ticket}; return GenericPost<IndividualTicketResponse>(_tickets + ".json", body); }
public async Task<IndividualUserResponse> UpdateUserAsync(User user) { var body = new { user = user }; return await GenericPutAsync<IndividualUserResponse>(string.Format("users/{0}.json", user.Id), body); }
public JobStatusResponse BulkUpdate(List<long> ids, BulkUpdate info) { var body = new { ticket = info }; return GenericPut<JobStatusResponse>(string.Format("{0}/update_many.json?ids={1}", _tickets, ids.ToCsv()), body); }
public async Task<IndividualUserIdentityResponse> UpdateUserIdentityAsync(long userId, UserIdentity identity) { var body = new { identity }; return await GenericPostAsync<IndividualUserIdentityResponse>(string.Format("users/{0}/identities.json", userId), body); }
/// <summary> /// The user whose id is provided in the URL will be merged into the existing user provided in the params. Any two arbitrary users can be merged. /// </summary> /// <param name="fromId"></param> /// <param name="intoId"></param> /// <returns></returns> public IndividualUserResponse MergeUser(long fromId, long intoId) { var body = new { user = new {id=intoId}}; return GenericPut<IndividualUserResponse>(string.Format("users/{0}/merge.json", fromId), body); }