HomeGuidesRecipesAPI EndpointsRelease NotesCommunity
Log In
Guides

Executing a Request

Executing a Request

Now that we have authentication configured, we can execute a simple Request.

For your first request, you will look up documents in Layar. You can expand your collection and search for the "sourceDocument" folder. Expanding that folder will show the various requests that you can make.

📘

Variables

You will notice that some of the sub-folders have names like {field} , {id} , or {projectComputationId}. These requests will require additional information in order to run. For instance, the {id} variable indicates the document ID, which can be found using the search request.

Expand the search folder since we are trying to search for a document.

We see a "Search for documents" POST request in the folder. Clicking on this will open the request with various sub-tabs at the center of the screen.

For this particular request, we will not need to use "Params." We also do not need to use "Authorization" since we already configured authorization for the whole collection.

We will need to configure some headers for the request. After clicking the "Headers" tab, you will notice that "X-Vyasa-Data-Providers" isn't filled out.

For this request, you can use the following values: master-pubmed.vyasa.com and master-pmc-oa.vyasa.com.

We will configure a simple filter on the "Body" tab. You might notice that when you first click on the tab, it fills out the raw JSON for the body, including all possible parameters.

The default raw JSON is a good reference for all the possible values you can use to search for a document. However, for this example, we want to query a specific term and find all related documents. We can change from "raw" to "form-data" using the radio buttons at the top of the window. You should see the following.

You can fill out only the values you want here, using the "raw" section as a guideline for valid values. For example, the value q allows you to search for a specific string. I can set the "Key" to q and "Value" with the string you want to search for. I've also added a rows key to limit the amount of documents that the search returns.

Now, we can hit the send button at the top left of the screen.

Information will return at the bottom of the screen in JSON format. Below, you can see the id for one of the documents returned in the search.

This ID can be used in other requests, such as to add the document to a Document Set.