Vtiger CRM REST API using Spring RestTemplate - java

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

Related

Getting AppIdentityServiceFailureException getAccessToken while fetch list of BQ tables for a particular dataset

When I try to fetch the list of tables present in a particular dataset I get this error. I was unable to find any solution online. Any ideas?
The problem is I was able to use this method last month. There are no changes to the code and to the environment. I'm not able to understand why it has suddenly stopped working.
com.google.appengine.api.appidentity.AppIdentityServiceFailureException
at com.google.appengine.api.appidentity.AppIdentityServiceImpl.getAccessToken(AppIdentityServiceImpl.java:290)
at com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential.intercept(AppIdentityCredential.java:100)
at com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential$AppEngineCredentialWrapper.intercept(AppIdentityCredential.java:245)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:897)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:499)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:432)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:549)```
As mentioned in the documentation AppIdentityService (Google App Engine API for Java):
getAccessToken(java.lang.Iterable scopes) OAuth2 access token to act on behalf of the application.
This clarifies that the method getAccessToken() is needed to use in the authentication, as it's using OAuth2, that requires further authentication.
In the below documentation, there is more information on how to use the method on your application and confirm that the token will be sent and received in your system.
Asserting identity to Google APIs
Let me know if the information helped you!

How can I find issue by user Springboot Jira API?

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

Magento REST API details or swagger doc

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!

Implementing express checkout (PayPal) using SOAP

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=

Spring and Klout Api

While I can use Spring Social framework to get info referred to an user from his account on Twitter or Facebook, is there a way to get info using Klout v2 api?
Actually, it seems an http get request is necessary.
So, how can I use my api key to get this information?
Klout API gives you influence scores and topics for a given user (twitter or google plus). It doesn't give any profile information. Need to use source APIs (wrappers like Spring Social) to retrieve those information. If you want to use klout v2 API for influence scores etc, you can use this Java wrapper - http://code.google.com/p/klout4java/

Categories

Resources