Hi,

I'm using java client in version 1.4.0 and for some for requests I'm getting 400 (Bad Request) while others are fine. Both are sent with same api key and secret.

For comparison I attach both request payloads - successful and unsuccessful one.

Payload of successful message: 
{"audience":{"or":[{"named_user":"DEF456"},{"named_user":"ABC123"}]},"device_types":["ios"],"notification":{"alert":"Disallowed! The goal has been ruled out by the referee. The score is Spain 4 - 0 Costa Rica (73')","actions":{"open":{"type":"deep_link","content":"whsbkh://?action=openLocation&url=/betting/en-gb/football/OB_EV11913436"}}}}

 

Bad request:

Payload of unsuccessful message: 
{"audience":{"or":[{"named_user":"GEF456"},{"named_user":"ABC123"}]},"device_types":["ios"],"notification":{"alert":"Disallowed! The goal has been ruled out by the referee. The score is DR Congo 1 - 1 Guinea (92')","actions":{"open":{"type":"deep_link","content":"whsbkh://?action=openLocation&url=/betting/en-gb/football/OB_EV11913424"}}}}

 

Stacktrace:

com.urbanairship.api.client.ClientException: Bad Request
	at com.urbanairship.api.client.ClientException$Builder.build(ClientException.java:128) ~[com.urbanairship.java-client-1.4.0.jar:na]
	at com.urbanairship.api.client.ResponseAsyncHandler.onBodyPartReceived(ResponseAsyncHandler.java:89) ~[com.urbanairship.java-client-1.4.0.jar:na]
	at com.ning.http.client.providers.netty.handler.HttpProtocol.updateBodyAndInterrupt(HttpProtocol.java:203) ~[com.ning.async-http-client-1.9.31.jar:na]
	at com.ning.http.client.providers.netty.handler.HttpProtocol.exitAfterHandlingBody(HttpProtocol.java:395) ~[com.ning.async-http-client-1.9.31.jar:na]
	at com.ning.http.client.providers.netty.handler.HttpProtocol.handleHttpResponse(HttpProtocol.java:431) ~[com.ning.async-http-client-1.9.31.jar:na]
	at com.ning.http.client.providers.netty.handler.HttpProtocol.handle(HttpProtocol.java:470) ~[com.ning.async-http-client-1.9.31.jar:na]
	at com.ning.http.client.providers.netty.handler.Processor.messageReceived(Processor.java:88) [com.ning.async-http-client-1.9.31.jar:na]
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:142) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.codec.http.HttpContentDecoder.messageReceived(HttpContentDecoder.java:108) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.codec.http.HttpClientCodec.handleUpstream(HttpClientCodec.java:92) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [io.netty.netty-3.10.6.Final.jar:na]
	at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) [io.netty.netty-3.10.6.Final.jar:na]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_131]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_131]
	at java.lang.Thread.run(Unknown Source) [na:1.8.0_131]

 

Any suggestion what could be wrong?

Thanks

Didn't find what you were looking for?

New post

Comments

1 comment

  • Hi Martin,

    Thanks for writing in. As far as I can tell, the two requests have valid json and nearly identical payloads; the big difference appears to be the deep link being used. Could you let me know which app key you are using to make requests?

    I'd also like to note that as an employee of William Hill, you have access to our paid support resources. Please feel free to submit a ticket to us via the Support Portal and we can help you out via that medium as well.

    Comment actions Permalink
    0

Please sign in to leave a comment.