Hi there,
I need to solve this: when a form is created:
1) It needs to login to [login address] and get the "ServiceTicket" response
2) It needs to enter automatically this "ServiceTicket" response to "Basic Auth" field of another API request made to [add member address] to send some form data.
I can create an API autoresponder, retrieve the "ServiceTicket" response and add it to a hidden field in the form. Then I can create another API autoresponder which will trigger after a minute but I cannot figure out how will I add this response to the "Basic Auth" field.
Can you please help?
Auth credentials are usually static. This means that when you create the original API key in the target system, it never changes. You hard code it into your process. What do you mean when say you need to add the first API response to the Basic Auth field? That is a very unusual approach to multiple API calls. I'm not fully understanding what you want to accomplish here.
Hello Victor, Thanks for the reply. I have a static username and password to retrieve a ServiceTicket response first, then I need to enter this ServiceTicket value into "Basic Auth" field in order to send form data via API. Maybe I misunderstood the process?Here what the documentation tells me:
Url LIVE: https://api.relateddigital.com/resta/api/Member/InsertMemberDemography
Http verb POST
Parameters
Header Content-Type: application/json
Authorization: Service Ticket value retrieved after Login action.
My question is how to add this ServiceTicket value into my Send API data?
Thanks.
The link you provided doesn't work. It produces an error:
The requested resource does not support http method 'GET'.
The answer is I don't know. It would help to see what you're doing. If you want to post a video, please include the response from the first API call so we can see the JSON response.
Hello Victor thank you for your time.
I contacted them and they told me the system does not support GET method and we need to use POST instead. I managed to get a valid response with an online testing form (see attached SS).
All I need is to write this ServiceTicket value into the Basic Auth field of the second Send API data form which I don't know how.
Best.
Haluk
Unless I'm missing something, add the hidden field's shortcode to the the second API auth string.
Victor, thank you for your reply. I was away so I can continue now. There are 2 problems:
1) When I enter username and password to the first form I got an error as response but when I test the API online and POST { "UserName" : "MyUserName","Password" : "MyPassword" } as content I got the proper response as I mentioned earlier. Is there a way to pass this step with some code in functions.php. If yes, how?
2) Even thought that I got the ServiceTicket value from the first response, there is no way to enter this automatically into the Basic Auth field of the second Send API data form. Shortcodes do not work there.
Best,
Victor, thank you for your reply. I was away so I can continue now. There are 2 problems:
1) When I enter username and password to the first form I got an error as response but when I test the API online and POST { "UserName" : "MyUserName","Password" : "MyPassword" } as content I got the proper response as I mentioned earlier. Is there a way to pass this step with some code in functions.php. If yes, how?
2) Even thought that I got the ServiceTicket value from the first response, there is no way to enter this automatically into the Basic Auth field of the second Send API data form. Shortcodes do not work there.
Best,
Haluk, did you ever find a way to do this? I'm having the same problem trying to include a received Bearer token in the API header. The short code is ignored and it sends with the Basic auth.
Please login or Register to submit your answer