How to find the correct json schema to post to the magento endpoint and create an account?
Am able to create account only from the front end, I need to be able to do from the backend using curl or Postman.
http://{ipaddress}/index.php/customer/account/create/
This is an external api , i need to consume.
I want to post to this end point from java, however am not able to find the correct request schema of the json endpoint.
Any help to find the swagger end point or schema would be great
I am assuming you are talking about magento 1? Have you tried the REST API by chance? It's well written out on how you should make a call to it here.
If you need more functionality than just creating an account, you can also take a look at the SOAP API which handles more things, but does not support JSON from the box. They did implement the WS-I complaint mode to support Java calls, so maybe that's something you'd be interested in as well.
Good luck!
Related
I am working on a project in which I have to get existing Jira issues for a specific user. I have implemented the Jira REST API exactly how they show it on Baeldung.com but I have not found any api to get all issues for a user without having to use an ID.
The client library you mentioned from the article doesn't provide any method for retrieval of all the issues. You need to call search REST api directly which uses jql.
https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#searching-for-issues-examples
There is parameter jql where you can query for a user
jpql=assignee%20%3D%20557058%3Ac64112ec-589f-4b56-8bb6-9eea49e26364
The string after jpql= must be url encoded
What is the side effect of using get method in java rest web service instead of post or put or delete? I know I have to use get for retrieving data and post for saving. But, what if I used get instead?
You can but you will probably going against the design. There are many good discussion here and below are few references,
HTTP GET with request body
REST API using POST instead of GET
REST: Can I use POST request to read data?
User enters his query and search's for nearby places.
Can you tell me how to approach this problem to get the search and response from servlet where the user clicks search and the values are sent to google and the answer is returned back to servlet.
Thanks
From client you will make http call to your servlet and pass the search term. In your servlet you will the search term request parameter and will use google maps rest API to search based on that search term. You will consume the REST API response and return in your servlet response.
Have you referred to google maps documentation yet? Do you not understand the google maps documentation or you do not know how to consume rest API?
Refer to google maps APIs here and decide which information you looking for https://developers.google.com/maps/web-services/overview
Google maps have client API as well, you could use this directly. Please check https://developers.google.com/maps/web-services/client-library#terms_and_conditions
If you want to implement your own then just google java rest api client and you will find tons of options. There are many libraries which you can use to consume REST APIs e.g. cxf, jersey and spring.
Google maps can be integrated directly via Javascript if you want https://developers.google.com/maps/documentation/javascript/
I am trying to create a Java wrapper for Vtiger REST API. I want to avoid the use of vtwsclib library because I could not find its Maven artifact. I want to use Spring RestTemplate. Actually, I don't understand why I need some special library to access REST API of a webservice.
First a got into problem with login process. Even when I followed the instructions from this link, I was not be able to retrieve sessionName. Finally, I resolved it after some research of vtwsclib library.
Next problem is with the retrieve operation. Even when I had sessionName and tried to retrieve some object by id with request (a ticket I can see in client app)
GET .../webservice.php?operation=retrieve&sessionName=xxxxx&id=xxxxx
I got:
{"success":false,"error":{"code":"ACCESS_DENIED","message":"Permission to perform the operation is denied for id"}}
Last problem is documentation, even when I visited their wiki Vtiger WIKI I could not find attributes of Ticket entity to create fields map.
So the work with this API is a bit painful for me. My questions are:
Is there some tutorial how to obtain sessionName using only Spring RestTemplate?
Why retrieve operation failed? update: bad id format
This is the main question. Is there some better documentation (tutorial, blog, file, ect.) for Vtiger REST API and descriptions of objects like Ticket?
I am also using Spring RestTemplate for Vtiger rest api.
For Retrieving details of record using REST API we need to pass id as moduleId x recordID (2x1234) format, otherwise it will give ACCESS_DENIED Error
So, here's my challenge: I have to build a webservice which handles payments using PayPal... The SOAP way! Since I'm a Node developer I'm very familiar with REST but the challenge is that I have to build it with Java, XML-schemas and SOAP using the Spring-framework.
Now I found this workflow when using REST: https://devtools-paypal.com/guide/pay_paypal/java?interactive=ON&env=sandbox.
That looks easy as pie to me! But what would this workflow look like when using SOAP and how would you implement this. As in: How do you handle redirects and responseURLs? Or is the workflow different?
P.S. I know PayPal has lots and lots of documentation but when it comes to SOAP, I just can't figure out the workflow or how to handle responseURLs..
Thnx in advance!
I'm going to assume you want to implement Express Checkout.
The flow is basically the same, different endpoints, but same steps. You can see the workflow here:
https://developer.paypal.com/docs/classic/express-checkout/ht_ec-singleItemPayment-curl-etc/
Just reference the diagram. Everything below isn't specific to SOAP.
In brief, the flow looks like this:
1: Call SetExpressCheckout to get back a token.
2: Redirect to PayPal using token obtained in step 1.
3. If user accepts checkout then call GetExpressCheckoutDetails to get transaction details.
4. Use Token and PayerID (obtained in step 3) in call to DoExpressCheckoutPayment to capture payment.
Here's a good place to start: https://developer.paypal.com/docs/classic/api/#ec
The first snag I ran into when implementing the SOAP API versus the REST API was that I couldn't find anywhere in the documentation where to find the redirect URL. The REST API will send it back, the SOAP does not. I had to dig through some of the SDK files to find it.
Redirect to here: https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=