2017-02-16 47 views

回答

1

沒有直接的API調用與評論一起導出到excel。導出項目和應用程序

有一個工作要做到這一點。 1.根據附加的代碼進行評論API調用,您可以獲得關於Item的所有評論,以便您可以以編程方式將它們導出到您的Excel中。

public class APICall implements Serializable { 
public static void main(String as[]){ 
    APICall apiObj = new APICall(); 
    apiObj.apicall(); 

}

/** 
* 
*/ 
public void apicall() 
{ 
    try{ 
    System.out.println("inside"); 
    ResourceFactory resourceFactory = new ResourceFactory(new OAuthClientCredentials("<WS NAME>","<Your authkey>"),new OAuthUsernameCredentials("<username>", "<Password>")); 
    CommentAPI capi = new CommentAPI(resourceFactory); 
    Reference ref= new Reference(ReferenceType.ITEM,561530318); 
    List<Comment> cmts = capi.getComments(ref); 
    for(Comment e : cmts) 
    System.out.println(e.getValue());