Skip to main content
added 226 characters in body
Source Link
nicholaswmin
  • 2.1k
  • 2
  • 21
  • 38

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API by Vinay Sahni

Limiting which fields are returned by the API

The API consumer doesn't always need the full representation of a resource. The ability to select and choose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

Use a fields query parameter that takes a comma separated list of fields to include.

Example:

GET /customer?fields=id,subject,customer_name,updated_at

Now, I suppose you could go the extra step and HEAD it, instead of GET

HEAD /customer?fields=id,subject,customer_name,updated_at

which should return a 204 if it exists & a 404 if not.

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API by Vinay Sahni

Limiting which fields are returned by the API

The API consumer doesn't always need the full representation of a resource. The ability to select and choose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

Use a fields query parameter that takes a comma separated list of fields to include.

Example:

GET /customer?fields=id,subject,customer_name,updated_at

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API

Limiting which fields are returned by the API

The API consumer doesn't always need the full representation of a resource. The ability to select and choose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

Use a fields query parameter that takes a comma separated list of fields to include.

Example:

GET /customer?fields=id,subject,customer_name,updated_at

Now, I suppose you could go the extra step and HEAD it, instead of GET

HEAD /customer?fields=id,subject,customer_name,updated_at

which should return a 204 if it exists & a 404 if not.

Commonmark migration
Source Link

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API by Vinay Sahni

Limiting which fields are returned by the API

 

The API consumer doesn't always need the full representation of a resource. The ability to select and choose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

 

Use a fields query parameter that takes a comma separated list of fields to include.

Example:

GET /customer?fields=id,subject,customer_name,updated_at

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API by Vinay Sahni

Limiting which fields are returned by the API

 

The API consumer doesn't always need the full representation of a resource. The ability to select and choose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

 

Use a fields query parameter that takes a comma separated list of fields to include.

Example:

GET /customer?fields=id,subject,customer_name,updated_at

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API by Vinay Sahni

Limiting which fields are returned by the API

The API consumer doesn't always need the full representation of a resource. The ability to select and choose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

Use a fields query parameter that takes a comma separated list of fields to include.

Example:

GET /customer?fields=id,subject,customer_name,updated_at

deleted 115 characters in body
Source Link
nicholaswmin
  • 2.1k
  • 2
  • 21
  • 38

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API by Vinay Sahni

Limiting which fields are returned by the API

The API consumer doesn't always need the full representation of a resource. The ability to select and chosechoose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

Use a fields query parameter that takes a comma separated list of fields to include. For example, the following request would retrieve just enough information to display a sorted listing of open tickets:

Example:

GET /customer?fields=id,subject,customer_name,updated_at

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API by Vinay Sahni

Limiting which fields are returned by the API

The API consumer doesn't always need the full representation of a resource. The ability select and chose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

Use a fields query parameter that takes a comma separated list of fields to include. For example, the following request would retrieve just enough information to display a sorted listing of open tickets:

Example:

GET /customer?fields=id,subject,customer_name,updated_at

A fields parameter can take care of this.

  • In the example given in the question we could simply ask for the customerID field.

  • If the response provides a result then it exists.


From Best Practices for Designing a Pragmatic RESTful API by Vinay Sahni

Limiting which fields are returned by the API

The API consumer doesn't always need the full representation of a resource. The ability to select and choose returned fields goes a long way in letting the API consumer minimize network traffic and speed up their own usage of the API.

Use a fields query parameter that takes a comma separated list of fields to include.

Example:

GET /customer?fields=id,subject,customer_name,updated_at

Source Link
nicholaswmin
  • 2.1k
  • 2
  • 21
  • 38
Loading