Skip to content

Added verify api to java client #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 12, 2016
Merged

Added verify api to java client #11

merged 6 commits into from
Jan 12, 2016

Conversation

faizann
Copy link

@faizann faizann commented Dec 10, 2015

Modified service class to support DELETE request as it was being ignored. That was a bug.
Rest is just all verify related stuff

@marcelcorso
Copy link
Contributor

I was jut trying to compile the examples folder

cd ~/projects/java-rest-api/examples
mvn install

and got this error:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/vagrant/projects/java-rest-api/examples/src/main/java/ExampleVerifyToken.java:[46,11] exception java.io.UnsupportedEncodingException is never thrown in body of corresponding try statement
[INFO] 1 error
[INFO] -------------------------------------------------------------

and it looks correct.

my env

vagrant@vagrant-ubuntu-trusty-64:~/projects/java-rest-api/examples$ java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.3) (7u91-2.6.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
vagrant@vagrant-ubuntu-trusty-64:~/projects/java-rest-api/examples$

@marcelcorso
Copy link
Contributor

I sent the verify token

vagrant@vagrant-ubuntu-trusty-64:~/projects/java-rest-api/examples/target$ java -cp examples-1.0.1-jar-with-dependencies.jar ExampleSendVerifyToken live_lalalalalal 31624971134 "plz test, dude"
sending verify token request:
Verify { id=88fa7b7255694f89aaac815v11946352 href=https://rest.messagebird.com/verify/88fa7b7255694f89aaac815v11946352 recipient=31624971134 messages=Messages{href=https://rest.messagebird.com/messages/ee15198255694f89aae2923b79525268} status=sent createdDatetime=Tue Jan 12 12:59:06 UTC 2016 validUntilDatetime=Tue Jan 12 13:01:06 UTC 2016 }

then when I tried to verify


vagrant@vagrant-ubuntu-trusty-64:~/projects/java-rest-api/examples/target$ java -cp examples-1.0.1-jar-with-dependencies.jar ExampleVerifyToken live_lalalalalal 31624971134 196974
verifying token request: 196974
Exception in thread "main" java.lang.IllegalArgumentException: Illegal character(s) in message header field: Content-Type:
    at sun.net.www.protocol.http.HttpURLConnection.checkMessageHeader(HttpURLConnection.java:465)
    at sun.net.www.protocol.http.HttpURLConnection.isExternalMessageHeaderAllowed(HttpURLConnection.java:435)
    at sun.net.www.protocol.http.HttpURLConnection.setRequestProperty(HttpURLConnection.java:2767)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.setRequestProperty(HttpsURLConnectionImpl.java:316)
    at com.messagebird.MessageBirdServiceImpl.getConnection(MessageBirdServiceImpl.java:193)
    at com.messagebird.MessageBirdServiceImpl.getJsonData(MessageBirdServiceImpl.java:111)
    at com.messagebird.MessageBirdServiceImpl.requestByID(MessageBirdServiceImpl.java:73)
    at com.messagebird.MessageBirdClient.verifyToken(MessageBirdClient.java:357)
    at ExampleVerifyToken.main(ExampleVerifyToken.java:30)
vagrant@vagrant-ubuntu-trusty-64:~/projects/java-rest-api/examples/target$

It was throwing an error for some versions of Java. I don't know which or how, but at least it's correct now.
samwierema added a commit that referenced this pull request Jan 12, 2016
Add support for the Verify API
@samwierema samwierema merged commit 1e990ec into master Jan 12, 2016
@samwierema samwierema deleted the verify-api branch January 12, 2016 15:50
denizkilic pushed a commit that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants