Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Custom Error Codes on JSSP

davidl14970702
Level 5
Level 5

We are POSTing to a JSSP page in AC, and everything is working correctly but I need some help writing a response back to the headers in case a 200, 400 ect...

This is what I've got so far but it doesn't seem to be showing any error codes.

var rcp =

    <recipient

      _operation="insertOrUpdate"

      _key="@email"

      xtkschema="nms:recipient"

      firstName={request.getParameter("firstName")}

      lastName={request.getParameter("lastName")}

      email={request.getParameter("email")}

      profileID={request.getParameter("profileId")}

      JSSP_flag={"true"}

     />;    

   

  if( unLock == uuidKey ) { 

     nms.subscription.Subscribe(svc,rcp,create);

  }

  else 

  {   

    responseCode = 401;

    responseMessage = "Service Key is invalid";

    logWarning("Service called with unsupported key");

    addHeader.sendError(401);

    document.write('{\"responseCode\": \"'+responseCode+'\", \"message\": \"'+responseMessage+'\"}');

};

0 Replies