Using our APIs
How do I generate a "token" header (JWT) in FCC products ?
- Generate a token online through the https://jwt.io/ website by using the following steps:
1) Select the algorithm RS256 from the Algorithm drop-down menu.
2) Enter the header and the payload. For more information, see the 'Header and payload format' section below.
3) Generate an SSH Key Pair. Reference - https://docs.oracle.com/en/cloud/cloud-at-customer/occ-get-started/gener...
4) Enter the generated private key in the Private Key field of the Verify Signature section. Ensure that you have removed the public certificate from the Public Key or Certificate field, if the certificate exists.
A token is generated in the Encoded section. Copy this token and use it in the POST API request.
Header and Payload format:
The header consists of two parameters:
i) alg (Mandatory): The signing algorithm being used, such as RS256.
ii) typ (Optional): The type of the token, which is JWT.
For example:
{
"alg": "RS256",
"typ": "JWT"
}
The payload contains SHA-256 hash code of the JSON request body in below format:
{"data": "SHA-256 hashcode of JSON body"}
What are plans?
A plan is collection of API resources or subsets of resources from one or more API. A plan can contain a mixture of HTTP GET, PUT, POST, and DELETE verbs from different APIs or it can contain all the GET verbs from various APIs. A plan can have a common rate limit for all the resources or each resource can have a different rate limit. Rate limits specify how many requests an application is allowed to make during a specified time interval. Use this Developer Portal to browse the different plans that are available to you and select a plan that is most suitable for your requirements. Some plans have restricted access that you must request access to use. When you submit your request, the organization is notified, the API administrator assesses your request and they might contact you for more details. Other plans are available to use straight away.
How do I see my API usage?
The numbers of requests, for different APIs, that your application has made are shown on your application page. Click 'Apps' in the main menu and then click on your application. Under 'Subscribed Plans' you will see all plans your application is subscribed to. For each API contained in that plan you can see the usage compared to the rate limit of the plan.
How can I test an API?
It is possible to test an API from this Developer Portal. When looking at the details of an API you will see a table of the operations contained in the API. This will show what method they are (GET, POST, PUT, DELETE, PATCH, HEAD or OPTIONS) and what path the Resource uses. If you click on the Resource you will see more information about it, what parameters it might take, what it returns, what possible return codes it might use and what they mean. There is also a 'Try' button which enables you to try the Resource out direct from the Developer Portal. If the API requires a client ID or a client secret for identification then you can specify these at the top of the 'Try' section.
What is a webhook and how do I use it?
A webhook is a way for an application to provide other applications with real-time information. Instead of requiring you to pull information from an API at regular intervals, a webhook sends data to your application as soon as it's available.
To use a webhook with our API, follow these steps:
1.Register a webhook endpoint: Start by creating a URL endpoint in your application where you want to receive webhook notifications. This could be a dedicated route or a function that handles incoming webhook payloads.
2. Provide the registered webhook endpoint to Pelican: Once the URL endpoint is created at your end, inform pelican to configure it for you.
3. Handle incoming payloads: When an event occurs, our API will send a payload to the webhook URL you provided. Your application should then parse this payload and take appropriate action based on the information received.
4. Respond to the webhook: After processing the payload, your application should respond to the webhook with a status code indicating whether the payload was successfully received and processed. This helps ensure that our API knows your application received the notification.
By using webhooks, you can automate processes in your application and keep your data up-to-date in real-time without the need for constant polling.
For information regarding the authentication and payload structure, please contact Pelican.