Doubt on calling REELS Api in alpha

here what should we need to give in the x-access-token and Authorization section and where we can the values to provide in that section ?

  1. and also im planning like this first trigger this REELS for checking STP and NON-STP if it non stp i want to call another api which is used to create the case and im planning to do that api call in the same onclick so if the result is STP i want cancel that createCase api how to cancel that

@Sam @Paul_Thomas

Hi @Aswin ,

To pass the token on the REELS call on alpha you need to specify the key as token then change type to String then provide the token value on the value.
Please see the image below.

we need to generate the token using postman and give there right ?

Im not able to see the option for deleting the Authorization Field in the header

only provide token header and remove the other ones?
@Simphiwe

and can you check the second doubt which i have mentioned earlier?

  1. The token is generated on Reels on the token menu item. The image I attached is where you generate a token on Reels which you will pass as a header on your Reels call.
  2. To call an api conditionally you can use the custom code where you will check the stp and do what you want to do there.

1 Like

Ok But in the case creation section im not able to see a option to write code before making the call.

how do i do this condition check here @Simphiwe ?

1 Like

Hello @Aswin ,
If you want to use custom code, you can add a trigger and select the Custom Code option. You can then write your code there.

1 Like

i saw the custom code section and how we can trigger the next api call depend on the condition it is a new trigger right called case service how we can do that ??

Hello @Aswin ,
You can apply your condition in the Custom Code section and use fetch to make an API call. You can also use the same custom code for case creation, if needed

1 Like

can we use this api https://sandbox.neutrinos-apps.com/caseservice/case/instance/create

direclty in the fetch without creating a new trigger for case creation in the custom code depend on the condition ? is that a good approach or good practice ?

2.Right now i setted up the REEL api for stp checking and the result is binded with local and i can access the local in the custom code by using alpha.local.get() then perform the condition and use the fetch for api call for creation case. this is the flow which im planning please correct me if it is wrong

@Sam @Simphiwe

Hi @Aswin,

Yes, it’s possible to call an API from the custom code section. However, this should be the last resort because as the codebase grows, it becomes increasingly difficult to manage and debug, especially as the application scales. If Alpha already provides a built-in way to achieve this — like using triggers to call an API or a plugin — then it’s best to use that instead of adding custom code.

As I mentioned before, my approach would be to call a single API from SSD, integrate Reels there, and then handle the required logic based on the STP result within SSD.

I’m also aware of the issue you’re facing with integrating SSD APIs into Alpha. Let’s work on resolving that — I’ve commented on your post regarding this.

Yes I also had a view about that that’s why I tried to delegate difficult things to SSD so we can easily scale without modifying the alpha but unfortunately its not working I have tried using ngork still it’s not working ngork working in postman but not with alpha.thats why I changed my plan to avoid SSD in this