const url = 'https://platform.fomr.io/v1/unsplash/photos?query=example&page=1&per_page=20&orientation=landscape';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://platform.fomr.io/v1/unsplash/photos?query=example&page=1&per_page=20&orientation=landscape' \ --header 'Authorization: Bearer <token>'Searches free Unsplash photos to use as a form background, most relevant first. Show the user a few previews, then apply the chosen one with setFormBackgroundImage, which also credits the photographer. Needs forms:read or templates:read. Costs 1 API credit.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”What to search for, for example “abstract green leaves”.
The page of results, starting at 1.
Results per page.
Photo orientation. Backgrounds usually look best in landscape.
Responses
Section titled “Responses”Default Response
object
The photos on this page, most relevant first.
object
The ID of an Unsplash photo, as searchUnsplashPhotos returns it.
The name of the photographer, credited on the form.
The photographer’s Unsplash profile.
A small version of the photo to show the user.
How many photos match the search.
How many pages of results there are.
Example generated
{ "data": [ { "id": "example", "description": "example", "author_name": "example", "author_profile_url": "https://example.com", "preview_url": "https://example.com" } ], "total": 1, "total_pages": 1}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Every value the request got wrong.
object
The path into the request, with property names and numeric array indexes.
What is wrong with the value at this path.
The stable code for the issue. Branch on it, and use it with params to write your own text.
Accepted values when a node type or enum value is rejected.
Example
{ "code": "INVALID_INPUT"}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}A rejected call. The organization budget names the policy it rejected the call under; the request floor that bounds hammering sends the envelope alone.
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
The API Limit window that rejected the call.
The plan whose numbers were applied.
The policy limit in credits.
Credits already spent in the open window.
Credits still available under the policy.
What the rejected call would have cost.
How long the policy window lasts.
When the window that rejected the call ends.
Seconds to wait before retrying. Also sent as the Retry-After response header.
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT", "policy": "15m", "plan": "free"}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}Default Response
object
The requested operation has no available capacity. Retry after the Retry-After header says.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Seconds to wait before retrying. Also sent as the Retry-After response header.
Example
{ "code": "SERVICE_UNAVAILABLE"}