cURL Query Example

If you don't have Postman, you can also send a request via a regular HTTP request. In this case, we give an example that you can use with the cURL utility. The following query will get you all on demand programs which are 1 hour or less.

If you are using bash, use the following command:

curl --request POST "https://productsapi.pli.edu/content-graphql" \

--header "Content-Type: application/json" \

--header "Ocp-Apim-Subscription-Key: <your-subscription-key>" \

-d '{"query":"query GetOnDemandOneHour(\n $programFormats: [PLIProgramFormat],\n $programDuration: RuntimeSecondsFilterInput\n) {\n items(\n programFormats: $programFormats,\n programRuntimeSeconds: $programDuration\n ) {\n title\n productCode\n url\n }\n}","variables":{"programFormats":["ON_DEMAND_PROGRAM"],"programDuration":{"max":3600}}}'

If using Powershell, use the following command:

curl --request POST "https://productsapi.pli.edu/content-graphql" --header "Content-Type: application/json" --header "Ocp-Apim-Subscription-Key: YOUR_KEY" --data "{\"query\":\"query GetOnDemandOneHour($programFormats: [PLIProgramFormat], $programDuration: RuntimeSecondsFilterInput) { items(programFormats: $programFormats, programRuntimeSeconds: $programDuration) { title productCode url } }\",\"variables\":{\"programFormats\":[\"ON_DEMAND_PROGRAM\"],\"programDuration\":{\"max\":3600}}}"

Return to API Documentation