cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using data-gigya-api-link in screensets to call APIs with parameters is it officially supported?

damianomilani
Explorer
0 Kudos
5,231

I"m exploring the use of HTML links in SAP CDC screensets that leverage the data-gigya-api-link attribute. For example, I found this snippet:

<a data-disable-on-render="true" data-gigya-api-link="accounts.otp.sendCode" href="javascript&colon;void(0)" tabindex="0">Resend code</a>

This correctly triggers the accounts.otp.sendCode API. Now, I’d like to use the same mechanism to call other APIs, such as socialize.addConnection, which requires parameters like provider.

My questions are:

  • Is there an officially supported way to pass required parameters directly in the HTML markup?
  • Or is it necessary to handle this entirely via custom JavaScript?

Has anyone implemented this or found official documentation that covers this use case?

Thanks in advance!

Damiano

View Entire Topic
AnandRaj
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @damianomilani ,

API methods such as socialize.addConnection must be invoked through the SAP CDC JavaScript SDK, with all required parameters passed in JavaScript object. Passing parameters via HTML attributes is not supported and the SDK approach is the only officially supported method.

Also the data-gigya-api-link attribute is great for simple and declarative triggers like sending an OTP like your example or log out functionality. But for anything that requires dynamic input like choosing a social provider, passing user data then the SDK is the reliable and documented path.

Hope this is helpful

Regards,
Anand Raj