Sign up Form on your website

Scaleo allows you to host the Affiliate (or Advertiser) Sign Up form on your website. The configuration requires the tech skills as it uses API methods utilisation.

We have 2 options to handle Sign Up form and it is configurable at the Settings > Affiliates > Sign Up (Settings > Advertisers > Sign Up):

  • Auto Approve New User is ON: after the sign up, user is redirected to the Dashboard, without the approval
  • Auto Approve New User is OFF: after the sign up, user receives the message that his account should be reviewed. The network manages reviews the account and set it either Active or Rejected.

Let's review the both cases.

Auto Approve New User is ON

1

Use the NETWORK level API function to create the user:

Create Affiliate: https://developers.scaleo.io/#3ea61c02-26cf-4c67-a4c4-a30f507c8e14

Create Advertiser: https://developers.scaleo.io/#1ef54f49-c1e9-4632-a42c-01f6e807e682

Note: all fields should pass the validations when they come to Scaleo, the validation errors will be returned if any. You should handle this on your side.

2

If validation is passed you will receive the User ID and One-time Login Link. You can redirect to this link and user will be logged in into his account automatically.

{
  "status": "success",
  "code": 201,
  "name": "Created",
  "message": "Affiliate has been added successfully",
  "info": {
    "affiliate_id": 38,
    "one_time_login_link": "https://demo.scaleo.io/login?temporary_token=TURZelpXTmpaalk1TmpNME9HRTVaakU0T0daaU5qSmxOelEyTVRVeE5EWXdNVEExWWpWaVpGOHhOakExTnpJNU9EYzU="
  }
}
	

Note: One-time login link is functional only 1 hour since it was generated.

Auto Approve New User is OFF

Please use the API methods above to Create new users. Then you will be able to show your custom message about the approval process.


Example PHP Code

Below you will find an example PHP code for integrating a custom Sign up page.

<?php

const URL = 'https://{workspace}/api/v2/network/affiliates';

const API_KEY = '{api-key}';

$email = $_POST['email'];

$firstname = $_POST['firstname'];

$lastname = $_POST['lastname'];

$password = $_POST['password'];

$password_repeat = $_POST['password_repeat'];

$type = $_POST['type'] ?? 1;

$account = $_POST['account'];

$custom_field_7597 = $_POST['custom_field_7597'];

$custom_field_3578 = $_POST['custom_field_3578'];

$mustAgreePrivacyPolicy = $_POST['mustAgreePrivacyPolicy'];

$params = [

'email' => $email,

'firstname' => $firstname,

'lastname' => $lastname,

'password' => $password,

'password_repeat' => $password_repeat,

'account_type' => '1',

'contacts' => json_encode([

[

"type" => $type,

"account" => $account

]

]),

'status' => '1',

'custom_fields' => json_encode([

'custom_field_7597' => $custom_field_7597,

'custom_field_3578' => $custom_field_3578,

]),

'mustAgreePrivacyPolicy' => $mustAgreePrivacyPolicy

];

// var_dump($params);

$curl = curl_init();

curl_setopt_array($curl,

[

CURLOPT_VERBOSE => true,

CURLOPT_URL => URL . '?api-key=' . API_KEY,

CURLOPT_RETURNTRANSFER => true,

CURLOPT_ENCODING => '',

CURLOPT_MAXREDIRS => 10,

CURLOPT_TIMEOUT => 10,

CURLOPT_FOLLOWLOCATION => true,

CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,

CURLOPT_CUSTOMREQUEST => 'POST',

CURLOPT_POSTFIELDS => $params,

]

);

$response = curl_exec($curl);

// var_dump($response);

// var_dump($curl);

$out = json_decode(curl_exec($response), 1);

curl_close($curl);

echo $response;

exit(0);


Note: Instead of {workspace} it should be your Tracking URL. For example,  mycompany.scaleo.app . Also, instead of the {api-key}, you need to use the manager's API key.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us