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,230

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
shemma65
Advisor
Advisor
0 Kudos

Hi @damianomilani ,

 

You have 2 options.

1. use the link element, to use the link element and add the "provider" property, you must pass it in the showScreenSet request and it will be picked up automaticlly.

2. use our button element, and implement the onButtonClicked event (see https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/aac686baa2f14a388...), this way you can customize it to your own needs.

 

Note: regarding the documentation of "data-gigya-api-link", we will take it with the relevant people to update the Doc accordingly.

damianomilani
Explorer
0 Kudos

@shemma65it is not clear what you have in mind with the option 1. For now I solved with a label with a text similar to this:

<a href="javascript&colon;gigya.socialize.addConnection({provider:'Apple',callback: function(r) {gigya.accounts.switchScreen({screenSet:'Default-ProfileUpdate',screen:'gigya-update-profile-screen'})}})">Add Apple</a>