Google MyBusinessInformation API, where are the services? - rest

I'm stuck with the BusinessInformation API, actually I can add custom categories and services bound to it in the Google MyBusiness interface, but I'm still trying to figure out how to do the same using the API.
So far I found the way to get all the categories here, but I'd like to only get the categories that are bound with my current location.
Then about the services bound to each category, I couldn't figure it out what I only got similar is that link but it's deprecated.
Does someone know the way to do this?
Best

Sorry for this, actually it's OBVIOUS: those are attributes of the Location object.
I'll leave this here though, just in case that someone falls in the same trap.

Related

Problem with the contacts endpoint regarding "related_contacts"

I have a problem with the contacts endpoint regarding related_contacts.
I'm trying to make this request:
https://app.clio.com/api/v4/contacts.json?fields=id,name,first_name,last_name,type,primary_email_address,primary_phone_number,is_client,activity_rates{rate,flat_rate},addresses{name,street,city,province,postal_code,country},custom_field_values{id,field_type,field_name,value,custom_field},phone_numbers{name,number,default_number},web_sites{name,address,default_web_site},account_balances{name,type,balance},related_contacts{id,type,name,first_name,last_name,primary_email_address,primary_phone_number,is_client},primary_work_address{name,street,city,province,postal_code,country},company{id,type,name,first_name,last_name,primary_email_address,primary_phone_number,is_client},payment_profile{id,name,terms,discount_rate,discount_period,interest_rate,interest_period,interest_type},co_counsel_rate{id,rate,flat_rate,contact_id,co_counsel_contact_id},primary_web_site{name,address,default_web_site},created_at,updated_at&type=Company&client_only=true&order=name(asc)&limit=200
But it fails. If I remove the related_contacts{} part, it works. If I add back so much as related_contacts{id} it fails.
Has anyone else run into this?
I don't think this exactly answers your question, but I've been struggling with the same thing and as best I can tell, related_contacts is a dead-end in the API.
The real answer I think is not to use related_contacts at all, instead use the relationships endpoint. If you log on to the Clio portal and look at "Related contacts" under matter, this is actually the call that it's making.
You could call all relationships as you calling all contacts in your sample, but it's probably much more useful to include either the matter_id or contact_id as part of the query string to get relationships specific to one or the other.

Restful resource naming for "secondary" tables

Let's go with my example, I have 3 tables and I want to know what's the best method to name my resource url.
Tables:
building
building_type The most simple to define is #1.
API resources:
GET someapi.com/buildings
GET someapi.com/**?**
My problem is that I don't know what's the best practice for "secondary tables" like building_type.
Maybe:
GET someapi.com/buildings/types
GET someapi.com/building-types
...
I hope some of you will reach to enlighten me. Thanks.
You first need to figure our the requirements for your API, the scenarios, use cases etc, and only then actually start building it.
To go back to your question, I'd go for GET someapi.com/buildingTypes, because /buildings/types will leave you with a "Types" resource which doesn't make much sense on it's own. You could indeed make it so it's only accessible once you go to the buildings resource, so GET someapi.com/buildings/buildingTypes could be the way to navigate to it.

How to define URI for types of a certain resource

Currently, I have an API for showing a list of spots using this route: GET /spots
I also have an API which gets the details for a certain spot: GET /spots/{spot-id}
Now, I will be making another API, which shows all the categories of the spots. Do you guys know of a proper way to go about with this?
So far I have decided on using GET /spots/categories but my manager said it was kind of weird for the spots resource to have categories.
His current suggestions are GET /spot-categories and GET /spotcategories.
Also, for reference, I have database tables spot and spot_category.
Thank you!
I tend to agree with your manager, your spotcategories look like a different entity altogether, so as a resource it deserves a separate url. That being said, if the goal is to find the categories for a particular spot (as opposed to simply browsing through the different available spotcategories), you should only be able to navigate to them through the spots (presuming your API is on level 3 of the Richardson Maturity Model). As in a link from the spots to the categories (or simply embed them, depending on the usage requirements).
So you might end up with something like
GET /spots/{spot-id}/categories

async autocomplete service

Call me crazy, but I'm looking for a service that will deliver autocomplete functionality similar to Google, Twitter, etc. After searching around for 20 min I thought to ask the geniuses here. Ideas?
I don't mind paying, but it would great if free.. Also is there a top notch NLP service that I can submit strings to and get back states, cities, currencies, company names, establishments, etc. Basically I need to take unstructured data (generic search string) and pull out key information with relevant meta-data.
Big challenge, I know.
Sharing solutions I found after further research.
https://github.com/haochi/jquery.googleSuggest
http://shreyaschand.com/blog/2013/01/03/google-autocomplete-api/
If you dont want to implement it yourself, you can use this service called 'Autocomplete as a Service' which is specifically written for these purposes. You can access it here - www.aaas.io.
you can add metadata with each record and it returns metadata along with the matching results. Do check out demo put up on the home page. It has got a very simple API specifically written for autocomplete search
It does support large datasets and you can apply filters as well while searching.
Its usage is simple - Add your data and use the API URL as autocomplete data source.
Disclaimer: I am founder of it. I will be happy to provide this service to you.

Method to allow email recipients to change their account information

I'm using SugarCRM Community Edition. I have a bunch of contact information. There are fields I have empty that would like filled. I want each user to be able to fill out a form and fill in those fields.
I'm not sure how to hook each contact into the database. I imagine creating a generic form that somehow hooks into the database using a key. The form/php is not the issue. What is the 'key' and where is the 'door'? I think the door is the SOAP API but I'm not sure. The key, maybe the tracker id?
The only thing I am familiar with as far as interaction between an email campaign and the contact is the campaign 'Tracker'. I know the tracker url with removeme is used for allowing the user to opt out of emails. Is there a way to use this tracker to allow the person to edit their information? I think the answer to this is easy but I need some guidance.
One way of doing this is using the built-in REST api. There are a couple of helpful tutorials out there, here is a link to the one I used for guidance in a similar situation.
You can have a form post the data to your sugar crm's REST gateway, accessible via the url http://localhost/sugar/v2/rest.php.
Although it is quite straightforward to implement, you may want to look at this wrapper class that can be used to maybe keep things cleaner than the hacked up script churned out on the spur of the moment I used in my project.
Last but not least, be sure to glance over the documentation, in the Web Services section you will find more information.
Good-luck