POST campaigns/:campaign id/registrations

From Social ID Developers
Jump to: navigation, search

Deprecation notice: this API is deprecated since July 19, 2018.

Contents

Description

Creates a new registration in the Social Login Webform, according to the custom field definition configured in the platform.

In order to prepare the field "fields" to be user id this API, use the "Database Name" informed when the custom field was configured in the webform. A validation error (422) may be returned if the informed fields do not match the ones configured in the platform. Examples:

  • a field is informed but it is not configured in the platform.
  • a required field was not informed.
  • a validation error happened due to field type mismatch.

It is not necessary to inform all configured fields, given that some may be optional and/or auto-filled by the social networks or previous registrations (the database name keeps an history of previous filled values), according to the custom field configuration. In order to make sure the field is not auto-filled, be sure to inform the field with its desired value.

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 or 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 configured in the platform.

Authentication

This API requires 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 Login App associated with the webform, or the campaign_id does not belong to the 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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox