Api-platform: Question : How to deal with external resources ? (Using URL as URI ?)

Created on 20 Apr 2016  路  4Comments  路  Source: api-platform/api-platform

I use API Platform since a year now, and I have a problem to solve about external resource and I request opinion of the API Platform community to deal with it.

The case : My API use external resources provided by other APIs

Example : A Comment API for Movies.
szkeduxyg1mwykmlfpaxmzw

I think the usage of JSON-LD help us to deal with this kind of resources.
Instead having internal resources like : "/movies/1" we use the full url resources like "http://api.imdb.com/movies/1" or "http://api.allocine.fr/films/one". So we can use URL as URI for our POST/PUT/GET requests.

Questions

  • In the API return, if we are using external resources we must have the full URL right ?
  • How to store a link with an External resource in database ? A string ? What's your opinion about performance, etc ... ?
  • How to deal with Doctrine entities ? Its kind of relation but through an API ...
  • Have you some experience with this kind of thing to share with me ?

Thanks for your returns !

question

Most helpful comment

Consider your url as a regular string like any textual value, not as a relation (as it's not one in your Doctrine schema).

All 4 comments

I think a string would be right. And it's not treated as a relation... What do you need to do with it?

Consider your url as a regular string like any textual value, not as a relation (as it's not one in your Doctrine schema).

@MLKiiwy Did you find the solution, did @vincentchalamon respond to your question ?

Hi! I'm looking for example for using external resources in our api. Where can I find some hints about this problem?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ajaunasse picture ajaunasse  路  3Comments

florent-andre picture florent-andre  路  3Comments

mikemilano picture mikemilano  路  3Comments

martijnhartlief picture martijnhartlief  路  3Comments

maximilienGilet picture maximilienGilet  路  3Comments