I am new to marketing cloud. I am using the Fuel SDK for Java. I am trying to query data inside a data extension.
So far, I have been using my colleagues clientID and clientSecret but the problem was that I was able to get a whole list of data extension we currently have, but no fields within the data extension is currently being returned so I'm assuming it might be a read/write issues since when I output the response, all the
column field are an empty array even though they have data in them..
This is the code:
ETConfiguration configuration = new ETConfiguration(); configuration.set("clientId", clientId); configuration.set("clientSecret", clientSecret); ETClient client = new ETClient(configuration); //https://@@@@@@@.soap.marketingcloudapis.com/Service.asmx ETSoapConnection soapConnection = new ETSoapConnection(client, "https://@@@@@@@.soap.marketingcloudapis.com"); ETFilter etf = new ETFilter(); ETExpression expression = new ETExpression(); expression.setProperty("name"); expression.setOperator("="); expression.setValue("Customer_extension"); etf.setExpression(expression); //Gets the table ETResponse<ETDataExtension> response = client.retrieve(ETDataExtension.class); System.out.println(response);
I have now gone and created an API Integration app in the installed packages section and it shows my clientID and clientSecret. But when I place them in the above code, I get the following:
Exception in thread "main" com.exacttarget.fuelsdk.ETSdkException: error obtaining access token (400 Bad Request) at com.exacttarget.fuelsdk.ETClient.requestToken(ETClient.java:356) at com.exacttarget.fuelsdk.ETClient.requestToken(ETClient.java:313) at com.exacttarget.fuelsdk.ETClient.<init>(ETClient.java:159) at com.example.soap.SoapApplication.main(SoapApplication.java:34)
So my question is that, how do I authenticate myself since I thought the SDK does it automatically, and secondly why are the
column fields in the response all empty?