User passwords may be updated through the PayTrace API. PayTrace offers two types of user profiles, web users may access the PayTrace system through both the web interface and the API while API user profiles may only access PayTrace through the API. Web user passwords must be changed at least once every 90 days, while API User passwords/tokens must only be changed once a year. Please visit the User Accounts page to learn more about these users and passwords.
Update User Password Request
Required Name Value Pairs
UN, PSWD, TERMS, METHOD, NEWPSWD, NEWPSWD2
Optional Name Value Pairs For Exporting Recurring Transactions Request
The PayTrace API does not allow any optional name / value pairs for updating a user password request.
Sample Updating a User Password Request
‘format the request string to update a password
strRequest = "un~demo123|pswd~demo123|method~updatepassword|terms~Y|"
strRequest = strRequest & "newpswd~ demo12345|newpswd2~ demo12345| "
strResponse = SendPayTraceAPIRequest(strRequest) ‘defined in Referencing the API Page
Request Response
Returned Name Value Pairs
Each update password request sent to the PayTrace API should elicit a response. However, your application should validate the response to ensure it is not empty. Your application will also need to parse the response to determine if errors occurred. Your application will certainly also need to display any errors or successful responses to the user.
Responses elicited from an UpdatePassword request will always return either one or more error messages or a response.
Example of Parsing an Update User Password Response
‘declare tools to loop through the response and store the current name / value pair
Dim arrResponse() as String
Dim arrPair() as String
Dim Counter as Integer
‘declare the tools to store the values of the appropriate responses
Dim strError As String
Dim strResponseMessage As String
‘check to make sure the response was not empty/invalid
if strResponse <> “” and inStr(strResponse,”|”) > 0 and inStr(strResponse,”~”) > 0 then
arrResponse = split(strResponse, “|”) ‘split the response into an array of name/value pairs
for Counter = 0 to uBound(arrResponse)-1
arrPair = split(arrResponse(Counter), “~”)
If UCase(arrPair(0)) = "ERROR" Then
StrError = strError & arrPair(1)
ElseIf UCase(arrPair(0)) = "RESPONSE" Then
strResponseMessage = arrPair(1)
End If
next
Else
StrError = StrError & “The response from the PayTrace API was invalid."
End if
If StrError <> “” then
MsgBox “Password update was not successful per the following error: ” & StrError
Else
MsgBox “Password update was successful: ” & strResponseMessage
End if