echonovum Docs Help

POST item

POST method/en/v1/custom-access-codes

Request parameters

curl -X POST \ -H 'X-EchonovumApi-Key: YOUR_API_KEY' \ -H 'Content-Type: application/vnd.api+json' \ -d '{ "data": { "type": "CustomAccessCodeV1", "attributes": { "singleParticipation": true, "expiresAt": "2020-06-23T21:27:00.000+01:00" }, "relationships": { "subject": { "data": { "type": "ProfileV1", "id": "/en/v1/profiles/86a8a563-93c6-5ee0-8925-45d32e02490b" } }, "object": { "data": { "type": "ProfileV1", "id": "/en/v1/profiles/86a8a563-93c6-5ee0-8925-45d32e02490b" } }, "survey": { "data": { "type": "SurveyV1", "id": "/en/v1/surveys/61cd3277-542e-11ea-a019-4201ac1ac00f" } } } } }' \ https://api.echonovum.com/en/v1/custom-access-codes
const API_KEY = process.env.ECHONOVUM_API_KEY; const response = await fetch('https://api.echonovum.com/en/v1/custom-access-codes', { method: 'POST', headers: { 'X-EchonovumApi-Key': API_KEY, 'Content-Type': 'application/vnd.api+json' }, body: JSON.stringify({ "data": { "type": "CustomAccessCodeV1", "attributes": { "singleParticipation": true, "expiresAt": "2020-06-23T21:27:00.000+01:00" }, "relationships": { "subject": { "data": { "type": "ProfileV1", "id": "/en/v1/profiles/86a8a563-93c6-5ee0-8925-45d32e02490b" } }, "object": { "data": { "type": "ProfileV1", "id": "/en/v1/profiles/86a8a563-93c6-5ee0-8925-45d32e02490b" } }, "survey": { "data": { "type": "SurveyV1", "id": "/en/v1/surveys/61cd3277-542e-11ea-a019-4201ac1ac00f" } } } } }), });

Responses

{ "data": { "type": "CustomAccessCodeV1", "attributes": { "code": "5S767T", "singleParticipation": true, "createdAt": "2023-11-09T06:28:02+00:00", "expiresAt": "2020-06-23T21:27:00.000+01:00" }, "relationships": { "subject": { "data": { "type": "ProfileV1", "id": "/en/v1/profiles/86a8a563-93c6-5ee0-8925-45d32e02490b" } }, "object": { "data": { "type": "ProfileV1", "id": "/en/v1/profiles/86a8a563-93c6-5ee0-8925-45d32e02490b" } }, "survey": { "data": { "type": "SurveyV1", "id": "/en/v1/surveys/61cd3277-542e-11ea-a019-4201ac1ac00f" } } } } }
Last modified: 27 May 2024