Formulario HTML / Script JS Newsletter

Cómo enviar contactos a Woowup desde el popup de registro en tu web mediante un script

Si tienes un popup o landing en el cual pides datos a tus usuarios para que se registren al newsletter o a alguna promocion, es posible enviar este usuario a Woowup mediante un llamado simple de AJAX.

Ejemplo jQuery

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>My Ecommerce</title>
	<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
	<script>
		var settings = {
			"async": true,
			"crossDomain": true,
			"url": "https://events.woowup.com/events/users",
			"type": "POST",
			"headers": {
				"cache-control": "no-cache",
				"content-type": "application/json"
			},
			"data": JSON.stringify({
				"app": "CLAVE_PUBLICA_WOOWUP",
				"service_uid": "9988776655",
				"document": "1122334455",
				"email": "john@doe.com",
				"tags": "ecommerce,newsletter",
				"birthdate": "1989-06-22",
				"telephone": "+549116655443322",
				"gender": "M",
				"first_name": "John",
				"last_name": "Doe",
				"custom_attributes": {
	                "one_attribute": "one value",
		            "other_attribute": "other value",
	            }
			})
		}

		$.ajax(settings).done(function (response) {
			console.log(response);
		}).fail(function (error){ 
		        console.log(JSON.stringify(error)) 
		});
	</script>
</head>
<body>
</body>
</html>

Parámetros disponibles para enviar

Parameter

Required

app

yes

Account identificator

service_uid

No

Customer's identificator

email

No

Customer's email

telephone

No

Customer's telephone

tags

No

Comma separated tags

birthdate

No

Customer's birthday Format: YYYY-MM-DD

gender

No

Customer's gender. Must be "F" or "M"

first_name

No

Customer's first name

last_name

No

Customer's last name

mailing_enabled

No

The user can or can't receive emails. Values: "enabled", "disabled".

mailing_enabled_reason

No

Reason why the user can't receive emails.

sms_enabled

No

The user can or can't receive SMS. Values: "enabled", "disabled".

sms_enabled_reason

No

Reason why the user can't receive SMS.

POST https://api.woowup.com/apiv3/users

Request Body

Name
Type
Description

mailing_enabled

string

The user can or can't receive emails. Values: "enabled", "disabled".

POST https://api.woowup.com/apiv3/users

Request Body

Name
Type
Description

mailing_enabled

string

The user can or can't receive emails. Values: "enabled", "disabled".

HTTP Response Codes

HTTP Code

Name

Description

200

Ok

Everything is ok

400

Bad Request

Invalid parameters

403

forbidden

Account doesn't exist

Ejemplo funcional jQuery 2.2.4

El código "app": "XXXXXX" lo conseguís dentro de Configuración > Claves para desarrolladores. Es necesario tener permiso de super admin para ver las claves.

Last updated

Was this helpful?