56

Is an API endpoint the 'method', like https://api.foursquare.com/v2/venues/ or the full URL including non-query-string parameters like https://api.foursquare.com/v2/venues/5104

In other words, are these two separate endpoints or considered the same endpoint? http://myapi.com/somemodel/1
http://myapi.com/somemodel/2

Laurel
  • 5,965
  • 14
  • 31
  • 57
Derek Dahmer
  • 14,865
  • 6
  • 36
  • 33

1 Answers1

61

According to this Wikipedia article, the endpoint is a web service, defined by a WSDL file, and

does nothing more than define the address or connection point to a web service. It is typically represented by a simple HTTP URL string.

Microsoft uses the term endpoint in various contexts, but they all amount to the same thing: the endpoint is the entire interface, not one particular method.

In the context of a REST endpoint, the endpoint would contain the requisite GET, PUT, POST and DELETE methods (as applicable).

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
  • 6
    So then http://myapi.com/mymethod/1 are http://myapi.com/mymethod/2 are both the same endpoint? – Derek Dahmer Feb 19 '11 at 04:27
  • 8
    Yes, provided the 1 and 2 are parameters to your methods, and not addresses to separate, complete endpoint interfaces in their own right (possible, but not the way I would design it). – Robert Harvey Feb 19 '11 at 04:34
  • 2
    actually based on that wikipedia definition, each url leads to a service providing data for the resource described by 1 and 2. So they are 2 differend endpoints. I think an endpoint should be a suffix only, and they can share the same base url. – HukeLau_DABA Jul 15 '14 at 17:38
  • @HukeLau_DABA: Have a look also at the way the Wikipedia article defines an "operation." – Robert Harvey Jul 15 '14 at 17:40