POST campaigns/:campaign id/registrations
Contents |
Description
Creates a new registration in the Social Login Webform, according to the custom field definition configured in the platform.
Para construir o campo "fields" a ser informado nesta API, use o "Nome no Banco de Dados" informado ao configurar o campo no Webform. Se os campos informados em "fields" não seguirem as especificações configuradas, um erro de validação (status 422) ou de forbidden (403) será retornado. Exemplo:
- foi adicionado um novo campo em "fields" que não foi configurado na plataforma.
- um campo obrigatório não foi informado.
- houve algum erro de validação de acordo com o tipo do campo.
Não é necessário informar todos os campos configurados na plataforma em "fields", pois eles podem ser opcionais e também auto-preenchidos pelas redes sociais ou por cadastros anteriores (o nome no banco de dados mantém um histórico de preenchimentos), de acordo com a configuração feita. Se você quer ter certeza que o campo não será auto-preenchido, informe-o no campo "fields" com seu respectivo valor.
Resource URL
POST https://api.socialidnow.com/v1/marketing/campaigns/:campaign_id/registrations
Parameters
URL Parameters
campaign_id | required | webform identifier. |
---|
JSON Parameters
user_id ou connection_id | required | user identifier in the Social Login platform, either by its user_id or by an active connection (connection_id). |
---|---|---|
fields | required | a hash in the format field:value, according to the fields configures in the platform. |
Authentication
This API requires Marketing Account authentication. See Authentication.
Response
Response Status
created (201) | The registration was created successfully. |
---|---|
unauthorized (401) | The authentication is wrong. See Authentication. |
forbidden (403) | An error happened in the field "fields". Either the informed user_id does not belong to the Social Login App associated with the webform, or the campaign_id does not belong to the Marketing Account. |
not_found (404) | The connection_id was not found. |
conflict (409) | The registration wasn't accepted due to an existing registration for the given user. This error may occur in webforms configured to receive at most one registration per user. |
unprocessable_entity (422) | Validation error in the field "fields". |
internal_server_error (500) | An unknown error happened. |
Examples
Request
Creates a new registration in the webform "284" for the user "23".
curl -iX POST 'https://api.socialidnow.com/v1/marketing/campaigns/284/registrations' \ -d '{"user_id":"23", "fields": {"endereco": "Rua Joao Vitor, 332", "complemento": "Apto 341", "cpf": "1234567890"}}' \ -H 'Content-type:application/json' \ --user 14:a8c8604cdf390db4fce83b7f683b422b97c0ab5ced88f9b303b69ff467a77314
Response
Response Headers
HTTP/1.1 201 Created Status: 201