fetch the data from the API

Certified Associate Developer

How can i get the data from the api into the interface ? like in my scenario i want the movie details once i enter my movie name , and the thing as i had created the intergration using the link and it's working .now i just want to know how can get the values in my interface once i click the movie and submit button.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hello 

    Integrations can be called like any other expression rules on interfaces, if it is a GET method integration you can call it in local variables or anywhere else on the interface.

    Example

    a!localVariables(
      /* Call the integration to query the external system */
      local!externalQuery: rule!GetUnsettledTransactionList(),
      
      /* Handle the response depending on the outcome */
      local!value: if(local!externalQuery.success,
        local!externalQuery.result,
        local!externalQuery.error
      )
    )

    If it is a POST method integration, it can be called only in the saveinto parameter on the interface.

    Example

    a!buttonWidget(
      label: "Place Your Order",
    
      /* Call the integration to update the external system when the button is pressed */
      saveInto: rule!AuthorizeCreditCardPayment(
        cardNumber: local!cardNumber,
        expirationDate: local!expirationDate,
        ccv: local!ccv,
        amount: local!amount,
        onSuccess: {
          /* Handle the successful response */ 
          a!save(local!result, fv!result)
        },
        onError: {
          /* Handle the error response */ 
          a!save(local!paymentErrorMessage, fv!error.message)
        }
      )
    )

    For detailed explanation please refer to the following documentation link

    Call_an_Integration

    Hope this helps

Reply
  • 0
    Certified Lead Developer

    Hello 

    Integrations can be called like any other expression rules on interfaces, if it is a GET method integration you can call it in local variables or anywhere else on the interface.

    Example

    a!localVariables(
      /* Call the integration to query the external system */
      local!externalQuery: rule!GetUnsettledTransactionList(),
      
      /* Handle the response depending on the outcome */
      local!value: if(local!externalQuery.success,
        local!externalQuery.result,
        local!externalQuery.error
      )
    )

    If it is a POST method integration, it can be called only in the saveinto parameter on the interface.

    Example

    a!buttonWidget(
      label: "Place Your Order",
    
      /* Call the integration to update the external system when the button is pressed */
      saveInto: rule!AuthorizeCreditCardPayment(
        cardNumber: local!cardNumber,
        expirationDate: local!expirationDate,
        ccv: local!ccv,
        amount: local!amount,
        onSuccess: {
          /* Handle the successful response */ 
          a!save(local!result, fv!result)
        },
        onError: {
          /* Handle the error response */ 
          a!save(local!paymentErrorMessage, fv!error.message)
        }
      )
    )

    For detailed explanation please refer to the following documentation link

    Call_an_Integration

    Hope this helps

Children
No Data