Skip to content
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

Got HTTP response code 403 when using 3Scale API through threescalesetup java project #28

Open
osamagotji opened this issue Mar 10, 2019 · 0 comments

Comments

@osamagotji
Copy link

osamagotji commented Mar 10, 2019

After running the following commands.

mvn exec:java -Dexec.mainClass=threescalesetup.SetupApp -Dexec.args="<myDomain> <myAccessToken> financeapidemo financeapidemo true productiondemo 'Finance API Demo for Agile Integration'"

I got the following response.

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.redhat:threescalesetup >---------------------
[INFO] Building threescalesetup 1.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ threescalesetup ---
java.lang.Exception: ERROR from 3scale : [403] ->
at threescalesetup.operation.ThreescaleManagment.sendPost(ThreescaleManagment.java:87)
at threescalesetup.operation.api.ServiceOperation.create(ServiceOperation.java:36)
at threescalesetup.SetupApp.main(SetupApp.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.lang.Thread.run(Thread.java:748)
java.lang.Exception: ERROR from 3scale : [404] -> {"status":"Not found"}
at threescalesetup.operation.ThreescaleManagment.sendPost(ThreescaleManagment.java:87)
at threescalesetup.operation.api.ApplicationPlanOperation.create(ApplicationPlanOperation.java:35)
at threescalesetup.SetupApp.main(SetupApp.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.lang.Thread.run(Thread.java:748)
java.lang.Exception: ERROR from 3scale : [404] -> {"status":"Not found"}
at threescalesetup.operation.ThreescaleManagment.sendPost(ThreescaleManagment.java:87)
at threescalesetup.operation.api.LimitOperation.create(LimitOperation.java:35)
at threescalesetup.SetupApp.main(SetupApp.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.lang.Thread.run(Thread.java:748)
Mar 10, 2019 5:53:45 PM threescalesetup.SetupApp main
INFO: -----------------IMPROTANT REFERENCE-------------------
Mar 10, 2019 5:53:45 PM threescalesetup.SetupApp main
INFO: --Successfully setup 3scale Service API..
Mar 10, 2019 5:53:45 PM threescalesetup.SetupApp main
INFO: --Created service [financeapidemo] id: [null]....
Mar 10, 2019 5:53:45 PM threescalesetup.SetupApp main
INFO: --Created application plan [productiondemo] id: [null]....
Mar 10, 2019 5:53:45 PM threescalesetup.SetupApp main
INFO: --Created Metrics and limits. Metrics id [null] Limite id: [null]....
Mar 10, 2019 5:53:45 PM threescalesetup.SetupApp main
INFO: -----------------IMPROTANT REFERENCE-------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.059 s
[INFO] Finished at: 2019-03-10T17:53:45+07:00
[INFO] ------------------------------------------------------------------------

I tried to debug the java project and found that it sends HTTP POST request to URL "https://<MyDomain>-admin.3scale.net/admin/api/services.json" with "Content-Type: application/x-www-form-urlencoded"

I also tried to send this POST request manually and got HTTP code 403 as well.
Not sure that this is because 3scale API had been changed or I did something wrong.

Is there any idea about this error ?

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

No branches or pull requests

1 participant