Function calling via REST
For this tutorial we are going to use the function Suggest Movie
, which takes two query params rating
and score
and returns a random movie that will satisfy the criteria.
Information
This is mock service, used only for testing and tutorials, it does not count towards your credit usage.
More information on the function can be found in the function library here.
Information
You can copy the complete url from the Parameters
tab, all the required information for each is shown.
For this example we are going request a 15 rated film, with a score over 5.5
Invoking the function
To call this function using curl (or import into a tool like postman) as follows:
curl --location 'https://api.jellyfaas.com/suggestmovie-cn16g6rdervlrpsg3sr0-4-s?rating=PG&score=5.5' \
--header 'jfwt: <web token>'
Information
To get the token, you will need to visit your profile page and get a token, click on the 'Get Token' button once logged in.
Imported into Postman:
Output
You should see (from curl) a film and the relevant information, you may get a different film:
or from Postman:
Congratulations, you just called your first function! Now look at the next tutorials, or play around with other functions!
Help, it didn't work
- First check the REST verb you are using is a
GET
, for this function it cannot be aPOST
PUT
orDELETE
. - Check you have pasted or typed in the correct api endpoint from here.
- Is the jwt token correct? i.e. do you have any spaces in the header? and make sure this is a
header
not aquery param
.
For further help, please contact support here
Next Steps
Next try calling with the SDK here