echonovum Docs Help

POST item(s)

POST method/en/v1/profiles

Use this endpoint to create new profile resources. Important information:

  • All profile resources have to relate to a profile schema.

  • The profile schema is required to be created before creating profiles. Profile schemas can be created in the echonovum Survey App.

  • The profile schema is used to validate the profile attributes. If the profile schema does not allow additional attributes, the profile will be rejected if additional attributes are given.

  • The profile schema is attached to the profile resource by the 'schema' relationship.

  • If a profile with the given identifier already exists, the profile will be updated.

  • Profiles are created asynchroniously. The response will be a 202 Accepted status code.

  • Profile validation is done synchroniously.

  • You can create one or several profiles (with the same schema) at once.

Request parameters

// payload to post a single profile { "data": { "type": "ProfileV1", "attributes": { "profile": { "Employee ID": "SIR", "Name": "Siri", "Department": "Customer Success", "Email": "siri@echonovum.com", "Mobile": "+41790000000", "Role": "CS Hero" }, "settings": { "allowMultisurvey": false } }, "relationships": { "schema": { "data": { "type": "ProfileSchemaV1", "id": "/en/v1/profile-schemas/86a8a563-93c6-5ee0-8925-45d32e02490b" } } } } }
# example to post a single profile via cURL curl -X POST \ -H 'X-EchonovumApi-Key: YOUR_API_KEY' \ -H 'Content-Type: application/vnd.api+json' \ -d '{ "data": { "type": "ProfileV1", "attributes": { "profile": { "Employee ID": "SIR", "Name": "Siri", "Department": "Customer Success", "Email": "siri@echonovum.com", "Mobile": "+41790000000", "Role": "CS Hero" }, "settings": { "allowMultisurvey": false } }, "relationships": { "schema": { "data": { "type": "ProfileSchemaV1", "id": "/en/v1/profile-schemas/86a8a563-93c6-5ee0-8925-45d32e02490b" } } } } }' \ https://api.echonovum.com/en/v1/profiles
// example to post a single profile with Node.js const API_KEY = process.env.ECHONOVUM_API_KEY; const response = await fetch('https://api.echonovum.com/en/v1/profiles', { method: 'POST', headers: { 'X-EchonovumApi-Key': API_KEY, 'Content-Type': 'application/vnd.api+json' }, body: JSON.stringify({ "data": { "type": "ProfileV1", "attributes": { "profile": { "Employee ID": "SIR", "Name": "Siri", "Department": "Customer Success", "Email": "siri@echonovum.com", "Mobile": "+41790000000", "Role": "CS Hero" }, "settings": { "allowMultisurvey": false } }, "relationships": { "schema": { "data": { "type": "ProfileSchemaV1", "id": "/en/v1/profile-schemas/86a8a563-93c6-5ee0-8925-45d32e02490b" } } } } }), });
// payload to post multiple profile { "data": { "type": "ProfileV1", "attributes": { "profiles": [ { "Employee ID": "SIR", "Name": "Siri", "Department": "Customer Success", "Email": "siri@echonovum.com", "Mobile": "+41790000000", "Role": "CS Hero" }, { "Employee ID": "FRE", "Name": "Fred", "Department": "Software Developer", "Email": "fred@echonovum.com", "Mobile": "+41790000001", "Role": "API Specialist" } ], "settings": { "allowMultisurvey": false } }, "relationships": { "schema": { "data": { "type": "ProfileSchemaV1", "id": "/en/v1/profile-schemas/86a8a563-93c6-5ee0-8925-45d32e02490b" } } } } }
# example to post multiple profiles via cURL curl -X POST \ -H 'X-EchonovumApi-Key: YOUR_API_KEY' \ -H 'Content-Type: application/vnd.api+json' \ -d '{ "data": { "type": "ProfileV1", "attributes": { "profiles": [ { "Employee ID": "SIR", "Name": "Siri", "Department": "Customer Success", "Email": "siri@echonovum.com", "Mobile": "+41790000000", "Role": "CS Hero" }, { "Employee ID": "FRE", "Name": "Fred", "Department": "Software Developer", "Email": "fred@echonovum.com", "Mobile": "+41790000001", "Role": "API Specialist" } ], "settings": { "allowMultisurvey": false } }, "relationships": { "schema": { "data": { "type": "ProfileSchemaV1", "id": "/en/v1/profile-schemas/86a8a563-93c6-5ee0-8925-45d32e02490b" } } } } }' \ https://api.echonovum.com/en/v1/profiles
// example to post multiple profiles with Node.js const API_KEY = process.env.ECHONOVUM_API_KEY; const response = await fetch('https://api.echonovum.com/en/v1/profiles', { method: 'POST', headers: { 'X-EchonovumApi-Key': API_KEY, 'Content-Type': 'application/vnd.api+json' }, body: JSON.stringify({ "data": { "type": "ProfileV1", "attributes": { "profiles": [ { "Employee ID": "SIR", "Name": "Siri", "Department": "Customer Success", "Email": "siri@echonovum.com", "Mobile": "+41790000000", "Role": "CS Hero" }, { "Employee ID": "FRE", "Name": "Fred", "Department": "Software Developer", "Email": "fred@echonovum.com", "Mobile": "+41790000001", "Role": "API Specialist" } ], "settings": { "allowMultisurvey": false } }, "relationships": { "schema": { "data": { "type": "ProfileSchemaV1", "id": "/en/v1/profile-schemas/86a8a563-93c6-5ee0-8925-45d32e02490b" } } } } }), });

Responses

Last modified: 27 May 2024