TwitterTonUploadResponse object returning null


#1

Hi Twitter Team,

I have created a Twitter Audience shell using the below code:
BaseAdsResponse ta = audienceApi.createTailoredAudience(accountID,“Test200”, TailoredAudienceDataType.EMAIL);

But i need to hash a data file .
< Please share the code to do this using java since i am not getting appropriate support from the sdk >

Now , while uploading the file using the below code:
TwitterTonUploadResponse upR = audienceApi.uploadTailoredAudience(file);

the object upR of TwitterTonUploadResponse is returning null.

Please help me with this.


#2

This was already provided in another thread where you asked the same question.

According to the documentation for TON upload, the expected response from the API should be HTTP 200 and no body. I haven’t used the Ads Java SDK myself, but it may be that there’s no meaningful response to return. Either way, if you have not hashed the file correctly, I wouldn’t expect this call to be successful.


#3

But i didn’t get the exact code for hashing. Atleast help with the part with how to hash the data file.

Tht will be great, i am stuck with this since long. I searched a lot on sdk but unabe to find any support for hashing the file


#4

Hey @kingams16

Please take a look at the sample script hosted here for more details around hashing audience files.