Posts

Showing posts from January 22, 2019

Upload a list of customers email to Google Ads Management API

Image
0 I am trying to upload a list of customers hashed email using this guide, and here's my code. File file = new File("/customerMatchHashed.csv"); InputStreamContent mediaContent = new InputStreamContent("application/octet-stream", new FileInputStream(file)); mediaContent.setLength(file.length()); try { Analytics analytics = initializeAnalytics(); analytics.management().uploads().uploadData("AccountIdHere", "UA-123456-1", "1223334444", mediaContent).execute(); } catch (GoogleJsonResponseException e) { System.err.println("There was a service error: " + e.getDetails().getCode() + " : " + e.getDetails().getMessage()); } I keep on running into this error. There was a service error: 400 : Invalid