Skip to main content
Question

Where to Put Application Token Code in URL Formula

  • November 21, 2019
  • 0 replies
  • 147 views

Forum|alt.badge.img+2
Hi,

I have been scouring trying to resolve this error. Can someone please help take a look and see where I am going wrong with this?
I am receiving this error:
<qdbapi>
<action>API_EditRecord</action>
<errcode>24</errcode>
<errtext>Invalid Application Token</errtext>
<errdetail>An Application Token must be supplied.</errdetail>
</qdbapi>

Here is my code:

var text GoToRecord =

URLRoot() & "db/" & [_DBID_PR_LINES] & "?a=API_GenAddRecordForm&_fid_30=" & URLEncode ([Record ID#])& "&z=" & Rurl() & "&apptoken=[insert token here]";

 

var text COName =

URLRoot() & "db/" & [_DBID_PR_LINES] & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#])& "&z=" & Rurl()

& "&_fid_11=CO#" & [Related Purchase Requisition]

& "&_fid_6=CO#" & [Change Order #] & " " & [Purchase Requisition - PO #] & "&apptoken=[insert token here]";

 

$GoToRecord

& "&rdr=" & URLEncode($COName)

-----------
Thank you,



------------------------------
Curtis Middleton
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+15
  • Registered
  • November 21, 2019
Curtis,

Here is the cheat sheet for all the ones I build

// Declare Token
var text Token ="abcdefghijklmnopqrstuv";

// Declare URLs

var text URLGenAdd =
  URLRoot() & "db/" & [_Table] &
  "?a=API_GenAddRecordForm&_fid_8=" & URLEncode ([Record ID#])&
  "&dfid=10" &
  "&z=" & Rurl();

var text URLAPIEdit =
  URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken="& $Token & "&rid=" &[Record ID#] & "&_fid_14="&1;

var text URLAPIAdd =
  URLRoot() & "db/" & [_Table] & "?a=API_AddRecord&AppToken=" &$Token & "&_fid_6=" & URLEncode ([Record ID#]);

var text URLEdit =

  URLRoot() & "db/" & Dbid() & "?a=er&rid="&URLEncode([Record ID#])&"&dfid=12"& "&z=" & Rurl();

// Java Execute URL
"<a href=\"javascript:" & "$.get('" & $URL  & "', function(){" & "location.reload();" & "});" & "void(0);\">"&$IMG&"</a>"


------------------------------
Don Larson
Paasporter
Westlake OH
------------------------------