Is there a json api call to get the tags for an entity in orocrm? - api

I wish to get the tags for the contact entities in orocrm vi the jsonapi. How do I get the tags as no tag relation is returned in the response?
I have found in the legacy rest api how to add tags. But still no way to retrieve the tags for an entity.

Related

Customizing snippet/other CS JSON API response fields

My requirement is to retrieve all email ids from web pages returned by Custom Search JSON API. I am referring the 'snippet' and 'og:description' fields of API reponse and retriving all email ids contained in these fields using regex match.
However in many cases, email ids present in webpages are not there in these fields. Hence, I am unable to get email ids from those webpages.
Is there is anyway to customize these(or any other) fields so that I can get email ids contained in webpages in Custom Search JSON API response.
We can customize snippet and og:description fields by adding/modifying structured data in html code however this can't be done in my case as I don't own the websites returned by Custom Search JSON API.
Thanks!

Missing product attributes in Commerce.js API response

I've had an issue when sending requests to fetch products from the Commerce.js API.
It's that I cannot retrieve the list of attributes I set for each product from the UI that this service provides.
Product Attributes
API Response
In the API docs, it is shown that it's possible to fetch the attributes of each product.
Otherwise, would you please suggest any alternative to Commerce.js that is highly customizable?
I had the same problem. In case you used Commerce SDK, I tried that at first but it seems that it doesn't return the attributes. Instead you can try retrieving the products using the fetch API with the secret key. That worked for me
Make sure the Attribute itself set to Visible, it's by default Private that can't be fetched

Spotify API track request with more artist details

Is it possible to make a request to get a spotify track and also request that the artist object contains their avatar?
Sample request https://api.spotify.com/v1/tracks/60EtWSoDRJSFmg99MKZi0x
Is it possible to get the artist's avatar url in the artist object?
No. You need to make another request. Embedded artist objects (in tracks and albums) all seem to be of the simplified type, which do not include images of the artist. See: https://developer.spotify.com/web-api/object-model/
Fetch https://api.spotify.com/v1/tracks/60EtWSoDRJSFmg99MKZi0x
Parse response
Fetch https://api.spotify.com/v1/artists/49gaZqfow2v8EEQmjGyEIw

Why sub resources need to be prepended with resource in URI?

Having a doubt on REST API URI design.
Let's consider each Post has one or more tags. So, a tag could be retrieved by
GET /posts/1/tags/1
Tags are stored uniquely in DB with an ID. So I could access full detail of a tag using
GET /tags/1
If Post information needed, then I could use query parameter
GET /tags/1?post=1
My question is why the first format widely suggested over second/third format.
Suggest me use case/scenario to prefer first format or complications with second/third format.
why the first format widely suggested over second/third format.
This is not the case. The three are used for different things.
You must first ask if a tag can exist without a post. I'd say yes. Because of this, the second form
GET /tags/1
is a good URI to get the representation of a tag.
Next, ask yourself if a post can have multiple tags. I'd again say yes. Because of this the first form is a good way to get a specific tag of a post. More general, the form
GET /posts/1/tags
returns all tags that are used for post 1. This is a collection resource. One of those tags is tag 1 which can be navigated to by
GET /posts/1/tags/1
Note that the first and the second form both identify tag 1. Both forms can be used at the same time.
The third form makes no sense at all. Query parameters after the ? like post=1 are generally used to filter a collection resource. One could say: "Give me all tags that are used on posts 1, 23, and 42. This could be formulated as
GET /tags?post=1,23,42
Here we filter the collection resource of all tags by a condition.
Your third form uses a query parameter post=1 on a single resource. But it makes no sense to filter a single tag.
A fourth form could be useful: Give me all posts that use a tag:
GET /tags/1/posts
This would return the collection resource of all posts that use tag 1.
And even a fith form with the same meaning as fourth would be possible:
GET /posts?tag=1
Summary:
When thinking about REST URIs, think about resources. What are your resource? What are the relations between them? Can one type of resource exist only "inside" another type of resource (a hotel room can only exist inside a hotel) or can it exist on its own (a tag can exist even if not post is tagged with it). What could be a subresource of another resource? What collection resources exist? How can they be filtered?

Tags Implementation in Objective-C

I have a "Note" entity for my application, where its attributes are "Title", "Body", and "Tags".
I'm having trouble with the "Tags" attribute; I want to be able to input multiple tags when creating the Note, and then the program will be able to give me other Notes that have the same tag (Exactly like how Stackoverflow uses tags for questions). I'm not quite sure what the relationship between the entities should be.
How should I approach this problem?
Create Tag entity and add to-many relationship from Note to Tag and also to-many relationship from Tag to Note (and set set them to be inverses of each other).
Tag shouldn't be an attribute, but a many-to-many relationship. A Note can have multiple Tags (I assume) and a Tag can be added to multiple different Notes.
This way you'll be able to set up a fetch request to return all the Notes that have a specific Tag.