Tweet Preview on sandbox errors out, and Java Ads API (W.I.P.)

sdk
sandbox
java

#1

Hello, I have not had much success on getting Preview to return a 200 or 201 status on Sandbox.
It seems to work without issue on
public static final String BASE_API_URL = “https://ads-api.twitter.com/”;
public static final String SANDBOX_BASE_API_URL = “https://ads-api-sandbox.twitter.com/”;

Also I started a Java Ads API

Marc


#2

@SteelHouse love that fact that you’re working on this Java SDK. I’m the developer behind Twitter’s SDKs so feel free to reach out directly. Let us know if there’s anything we can do to help support your efforts.

You are indeed correct that there is an issue with Tweet preview in sandbox. It’s definitely not a problem in your implementation. In my tests just now the preview service appears to be throwing internal errors and failing hard.

I’ll get the eng team that owns it to a take a look at it ASAP. Thanks for reporting the problem.


#3

Thanks, I am following the patterns in the Python, and Ruby SDK, so you have given a blue print of sorts
(you guys did the heavy lifting :slight_smile: )

I am going to add some Builder patterns, example :

	// get the first account
	Account account = client.getAccounts().get(1);
	
	String[] mediaIds = new String[]{"1212313"};
	
        // standard way of creating a preview
	List<Preview> previews = Tweet.preview(account, "Hello Ads some more text but no symbols");
	
	
	//Tweet Preview - using builder pattern
	Preview preview  = Tweet.previewBuilder().account(account)
				.status("Hello Ads from Java SDK")
				.media_ids(mediaIds)
				.build();

I am seeing some discrepancies between what can be done on sandbox vs standard api’s
at some point, could you put a wiki together, explaining the limitations of sandbox, I am writing all these unit tests only to find out the error is not an error when it’s not running on sandbox.

Thanks, this is MIT License, when I am done, you can fork it, and refactor it for your namespace, if you want, we can maintain it, we are a java shop, so we definitely need this.

Marc @ Steelhouse.com