Trying to create bulk read job for Zoho_Books but getting "Module not Available" from Postman - zoho

When trying to make a post request to {{api-domain}}/crm/bulk/v2/read with a body of
{
"callback": {
"url": "https://www.personalcalbackurl.com",
"method": "post"
},
"query": {
"module": "Zoho_Books",
"page": 1
}
}
I get an error in Postman of
{"status":"error","code":"MODULE_NOT_AVAILABLE","message":"Requested module Zoho_Books is not available.","details":{"api_name":"Zoho_Books","module":"Zoho_Books"}}
Is a bulk read not available for the Zoho Books module? The Postman request creates a bulk read job for the Contacts module so that's odd that Zoho Finance wouldn't allow a bulk read. I know this is Zoho CRM, but Zoho_Books shows up as Zoho Finance's API name and every time I search for "Bulk Read Zoho Finance" the CRM docs only show up. Am I missing something obvious?

You can create custom modules based on Zoho Finance inside of Zoho CRM and they'll come back with an API name of "CustomModule###" and you can use that custom module name to create a bulk read job. Worked perfectly!

Related

Why does it turn into an unavailable room when I create a google resource calendar with its API?

I'm going to create a google resource calendar room via its API (i.e. https://admin.googleapis.com/admin/directory/v1/customer/my_customer/resources/calendars). But the problem is, when I create one, it turns into an unavailable (crossed out) room within google calendar rooms and I couldn't find any attribute to make it available!
Here's the body request/response:
{
"kind": "admin#directory#resources#calendars#CalendarResource",
"etags": "\"CTyc505ppdmJR2motHVsU17kzItOkPo5vYViqlSF0rU/FB0b765ZgWIpTBaxn5YQIwZWWNM\"",
"resourceId": "9f698cdc-84f9-4688-95a7-c2207b4fa7ae",
"resourceName": "StackOverflow Test",
"generatedResourceName": "Orangery Hildesheim Nordstadt-EG-StackOverflow Test (3)",
"resourceEmail": "c_1881d77mmcaqsihgi426fseae6vnc#resource.calendar.google.com",
"capacity": 3,
"buildingId": "Orangery-Hildesheim-Nordstadt",
"floorName": "EG",
"resourceCategory": "CONFERENCE_ROOM"
}
Here's the output on google calendar:
After two months finally I found a solution!
In fact, the main problem is related to the lack of permission for those created resources for other users in the organization. To tackle this problem I used another google API named ACL (Access Control Level) ref, to set a privilege for other users. Basically, a google resource actually is a google resource calendar, so you can use ACL API to access that calendar. Moreover, the parameter to reach that calendar is resourceEmail as the unique ID of the respective resource calendar.
Here's the thing I did to make unavailable resources to be available (bookable):
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl
change calendarId with the value of resourceEmail of the google resource.
the body of the request:
{
"scope": {
"type": "domain",
"value": "orangery.io" # if you selected type as `domain` you should write your domain name here.
},
"role": "writer"
}
[NOTE]:
With this procedure, you will need to the https://www.googleapis.com/auth/calendar authorization scope as well.

How manage payment in Google Action using Transactions API

I have developed a Google Actions Application to buy physical goods. I followed this guide: https://developers.google.com/assistant/transactions/physical/dev-guide-physical-gpay
I get the correct request / response flow:
"paymentInfo": {
"displayName": "Mastercard *ommited for security*",
"googleProvidedPaymentInstrument": {
"instrumentToken": "*ommited for security*"
},
"paymentType": "PAYMENT_CARD"
}
and finally Google returns me an instrumentToken in base64, which I think I can decode and use the ID inside it to call the Stripe API: https://stripe.com/docs/api/charges/create#create_charge-source. I tested it and it works, but seems extrange to me... Do I have to do this for every order that is successful?
My question is: Do I have to call the Stripe API myself? Is there no way Google will do it for me? In case I have to send it, should I do it when I receive the request with this field "userDecision": "ORDER_ACCEPTED" and then update the order if the payment is successful?
I have read all the official Google documentation for Actions and I cannot understand the entire flow of interaction.
As #taintedzodiac mentioned in the comment, if you use Stripe as your payment processor then you will have to use Stripe explicitly each time. This is not something that the platform will do automatically.

Zoho API: Get the user that is making the request

I have seen Zoho APIs give us the option to get all kinds of user information, yet I cannot find any method to fetch info about the user that is currently making the request.
OAuth2 secured API's usually offer such an endpoint, like Google or Twitter do.
In their documentation there is something that looks like it:
https://www.zohoapis.com/crm/v2/users?type=CurrentUser
But then they shatter any hope with their explanation:
CurrentUser - To get the list of current CRM users
Is there any known way achieve this?
This is the right endpoint: https://accounts.zoho.com/oauth/user/info
It requires the aaaserver.profile.READ scope.
Example Response:
{
"ZUID": 123123123123,
"First_Name": "Example",
"Last_Name": "Name",
"Display_Name": "Example Name",
"Email": "example#email.com"
}
I have tested this personally and can confirm that the text on their docs is wrong.
They say:
CurrentUser - To get the list of current CRM users
But in reality, that endpoint really does return a single user everytime, the user to whom the oauth token belongs. So it's not returning "a list of current CRM users", but rather "the currently logged in user" - exactly as you desire.
So your gut was right, and that endpoint will achieve what you are trying to do.

Can't cancel a stripe subscription through Parse API when user has more than one subscription

I am building site that allows users to signup for multiple subscriptions. The Parse.com / Stripe API we use allows me to create multiple subscriptions for each user. However, if a user has more than one subscription, and I attempt to cancel any of them, I get an error that the user has more than one subscription and that I must identify which subscription I am referring to. The problem is, that I do attempt to pass the subscription ID to into the API (see below) but it just seems to get ignored. Stripe clearly supports this second parameter in their API, but the Parse documentation does not show a second "subscriptionId" parameter.
The following Parse Cloud Code (which works perfectly as long as the user has only one subscription)
Parse.Cloud.define("cancelStripeSubscription", function(request, response) {
Stripe.Customers.cancelSubscription(request.params.customerId, request.params.subscriptionId, true, {
success: function(httpResponse) {
response.success("Cancellation Complete");
},
error: function(httpResponse) {
response.error("Error: " + httpResponse.message);
}
});
});
Here is the relevant Parse/Stripe Cloud Code API - https://parse.com/docs/js/api/symbols/Stripe.Customers.html#.cancelSubscription
Here is the equivalent Stripe API clearly showing a second "subscriptionId" parameter. https://stripe.com/docs/api/node#cancel_subscription
I'm hoping that the Parse/Stripe module does support multiple subscriptions.
Thanks for any help!
Unfortunately, Parse's Stripe API library is pretty old and was built against an old version of the API when only 1 subscription was possible. You'd either just have to do 1 subscription per customer or generate the web request to Stripe's API yourself not using the library.

Google API - How can I get the gmail contact details page?

My application use google+ sign-up and login system.
When user click on gplus button allows my app to manage his gmail contacts.
After logged in, I can get all the gmail contacts very easily with a simple $.getJSON call.
Google response is a well structured JSON - feed and entries where I can find contacts fullname, email address, mobile number etc.
My problem is to be able to jump to the google details page of a specific contact.
Here my question: Do you know how can I do that?
I mean ... where is the contact unique identifier and how can I make a link that open the google details of that specific contact?
Thanks
Use Google+ data API instead. It returns with details of use including id of that user.
Its response is as below:
{
"kind": "plus#person",
"id": "118051310819094153327",
"displayName": "Chirag Shah",
"url": "https://plus.google.com/118051310819094153327",
"image": {
"url": "https://lh5.googleusercontent.com/-XnZDEoiF09Y/AAAAAAAAAAI/AAAAAAAAYCI/7fow4a2UTMU/photo.jpg"
}
}
Now, using that id, you can goto user details page at http://plus.google.com/your_id
for full details, see here: https://developers.google.com/+/api/#data

Resources