Projects

Projects encapsulate an entire campaign including Assets, QR Codes and Scans, capturing first-party data from customer touch points.

In the example of an ad campaign, a Project would represent the campaign itself, containing multiple Assets, gathering scan data which is directly relevant to the ad campaign. A future ad campaign should be instantiated with a new Project.

Attributes

Create Project By Account Id

Creates a new Openscreen Project.

Request Object

Returns

Returns the newly created Project object containing a unique identifier - projectId. Throws an error if the accountId is invalid.

1 2 3 4 5 const project = await os.account(accountId).projects().create({ "companyName": "My company", "description": "Connect new and existing clients to listings", "name": "Real Estate Listings" });
{ "entityType": "create_project_by_account_id.response_body", "accountId": "xxxxxxxxxxxxxxxxxxxxx", "project": { "entityType": "app.project", "projectId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "description": "This project is used for connecting new and existing cleints to my active listings. Each Asset represents a new listing", "created": "2021-08-27T18:41:36.840Z", "name": "Real Estate Listings" } }

Get Projects By Account Id

Retrieves Projects associated to an Openscreen account.

The number of Projects retrieved can be modified using the 'limit' field for up to 100 per request. The next batch of Projects can be retrieved using the 'lastKey' field - a hashed key that points to the last object of the current batch.

Returns

Returns a list of Project objects associated to an Openscreen accountId. Throws an error if the accountId is invalid.

1 const projectsByAccountId = await os.account(accountId).projects().get();
{ "entityType": "get_projects_by_account_id.response_body", "accountId": "xxxxxxxxxxxxxxxxxxxxxx", "lastKey": "xxxxxxxxxxxxxxxxxxxxx", "numberOfProjects": 1, "projects": [ "project": { "entityType": "app.project", "modified": "2021-08-27T18:41:36.840Z", "description": "This project is used for connecting new and existing cleints to my active listings. Each Asset represents a new listing", "projectId": "6b5ffa4d-9928-454d-ada1-aeddaea1c7ad", "created": "2021-08-27T18:41:36.840Z", "name": "Real Estate Listings" }] }

Delete Project

Deletes a Project.

Returns

Returns the recently deleted Project object. Throws an error if the projectId is invalid.

1 const deleteProject = await os.project(projectId).delete();
{ "project": { "modified": "2021-08-27T18:41:36.840Z", "description": "This project is used for connecting new and existing cleints to my active listings. Each Asset represents a new listing", "projectId": "6b5ffa4d-9928-454d-ada1-aeddaea1c7ad", "created": "2021-08-27T18:41:36.840Z", "name": "Real Estate Listings" } }

Get Project By Project Id

Retrieves details for a project. A valid projectId must be supplied in the request.

Returns

Returns a project object. Throws an error if the projectId is invalid.

1 const project = await os.project(projectId).get();
{ "entityType": "get_project_by_project_id.response_body", "project": { "modified": "2021-08-27T18:41:36.840Z", "description": "Connecting new and existing cleints to my active listings.", "projectId": "6b5ffa4d-9928-454d-ada1-aeddaea1c7ad", "created": "2021-08-27T18:41:36.840Z", "name": "Real Estate Listings" } }

Update Project By Project Id

Updates the name, description and/or companyName of a project. Other attributes of a project cannot be updated after creation.

Request Object

Returns

Returns the project object containing the recent updates. Throws an error if the projectId is invalid.

1 2 3 4 const project = await os.project(projectId).update({ name: "Sales", description: "My first Openscreen project." });
{ "entityType": "update_project_by_project_id.response_body", "project": { "entityType": "app.project", "created": "2021-11-16T13:43:31.585Z", "modified": "2022-02-17T17:08:55.000Z", "projectId": "00adc7ec-bde5-4924-bd9f-06649f535152", "status": "ACTIVE", "name": "Testing", "description": "My first Openscreen project.", "companyName": "", "scanCount": 3, "assetCount": 6, "contactCount": 0, "dynamicQrCodeCount": 19, "staticQrCodeCount": 1 } }