ZohoDeskPortalSDK.getDepartments(onCompletion: { (departments, error) in // on success, departments will return an array, error will return nil // on failure, error will return a value, departments will return nil }
Objective-C
[ZohoDeskPortalSDK getDepartmentsOnCompletion:^ (NSArray * departments, NSError * error) { // on success, departments will return an array, error will return nil // on failure, error will return a value, departments will return nil }];
部門の商品の情報を取得するには、以下のメソッドを使用します。
Swift
ZohoDeskPortalSDK.getProducts(inDepartmentID: <#T##String#>, params: <#T##[String : Any]?#>) { products, error in // on success, products will return an array, error will return nil // on failure, error will return a value, products will return nil }
Objective-C
[ZohoDeskPortalSDK getProductsInDepartmentID:<#NSString#> params:<#NSDictionary#>onCompletion:^ (NSArray * products, NSError * error) { // on success, products will return an array, error will return nil // on failure, error will return a value, products will return nil }];
部門の問い合わせ用のレイアウトに含まれる項目の情報を取得するには、以下のメソッドを使用します。
Swift
ZohoDeskPortalSDK.Ticket.getFields(<#T##params: [String : Any]?##[String : Any]?#>) { fields, error in // on success, fields will return an array, error will return nil // on failure, error will return a value, products will return nil }
Objective-C
[[ZohoDeskPortalSDKTicket getFields: <#(NSDictionary * _Nullable)#>onCompletion:^ (NSArray * fields, NSError * error) { // on success, fields will return an array, error will return nil // on failure, error will return a value, fields will return nil }];
問い合わせに添付ファイルを含めるには、以下のメソッドを使用します。
Swift
ZohoDeskPortalSDK.Ticket.addAttachment(with:<#Data#>, andName:<#String#>, using: <#ZDPUploaderDelegate?#>) { (attachment, error) in // on success, attachment will return a value, error will return nil // on failure, error will return a value, attachment will return nil }
Objective-C
[ZohoDeskPortalSDKTicket addAttachmentWith: <#NSData#>andName:<#NSString#>using: <#(id _Nullable)#>onCompletion:^ (ZDPortalAttachment * attachment, NSError * error) { // on success, attachment will return a value, error will return nil // on failure, error will return a value, attachment will return nil }];
if ZohoDeskPortalSDK.isUserLoggedIn { ZohoDeskPortalSDK.Ticket.add(withFields:<#T##[String : Any]#>) { (ticket, error) in // on success, ticket will return an object, error will return nil // on failure, error will return a value, ticket will return nil } } else { ZohoDeskPortalSDK.Ticket.addAsGuest (withFields: <#T##[String : Any]#>) { (ticketNumber, error) in // on success, ticketNumber will return a string value, error will return nil // on failure, error will return a value, ticketNumber will return nil } }
Objective-C
if (ZohoDeskPortalSDK.isUserLoggedIn) { [ZohoDeskPortalSDKTicket addWithFields:<#(NSDictionary * _Nonnull)#> onCompletion:^(ZDPTicket * ticket, NSError * error) { // on success, ticket will return an object, error will return nil // on failure, error will return a value, ticket will return nil }]; } else { [ZohoDeskPortalSDKTicket addAsGuestWithFields: <#(NSDictionary * _Nonnull)#> onCompletion:^(NSString * ticketNumber, NSError * error) { // on success, ticketNumber will return a string value, error will return nil // on failure, error will return a value, ticketNumber will return nil }] }