/recordaffiliatehit [POST]

Validate affiliate ID and record “hit” - unprotected.

This should be called when the URL contains affiliateid=.... It validates the affiliate ID and optionally records a “hit”. It may indicate that the client app should redirect to a new URL (if the affiliate has been suspended for bad behavior).

Parameters

  • siteid (numeric) [REQUIRED] - a valid site ID (required since we are not logged in at this point and have no member information)
  • affiliateid (string, max 100 chars) [REQUIRED] - the affiliateid value from the URL

Response Messages

403 Forbidden

If siteid is missing or invalid.

{ "fail" : "Invalid Argument" }

200 OK - success

The result always includes status which may be:

  • "ok" - the hit was recorded, the client should remember the affiliateid value (via a cookie or similar)
  • "invalid" - the affiliateid was not recognized, the client should not remember the value
  • "redirect" - the affiliate is suspended and the client should redirect to the redirecturl value If status is "ok", there will also be a cookie_expiry field in the result, which will indicate the number of days the client application should remember the affiliate for. If status is "redirect", there will also be a redirecturl field in the result, which will be the URL of a website to which the member should be redirected instead of proceeding
{
  "status" : "ok", // or "invalid" or "redirect"
  "redirecturl" : "..."
}