https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c702e896-17b6-4a39-b640-3a18edc96d71/launch.jpg

Last week, we made progress with linking our initial React UI pages and figuring out how we're going to build our JS API.


Goals

This week, we aim to implement most of our API calls and further work on the React UI pages, with options to manage individual bots and edit them.

**What are we looking to achieve?

  1. JS API implementations** We're aiming to get most of our functionality done first to ensure our solution can work before we start adding error handling.

2. Rework the upload page file input The input should only accept certain files, make relevant calls to our business logic API, and have some UX features like a progress bar to give feedback to the user.

3. Add pages to manage individual bots We need to have the ability to remap bots to different numbers, and delete them entirely.


Implementing the API calls

Based on the functionality we wanted our application to have, we knew what core API calls we would need. We've outlined these previously when defining the interface between our frontend and business logic.

For recap, this included methods to:

We initially had a lot of trouble getting our http requests to Twilio to work - we kept getting different status code errors.

url=
'<https://serverless-upload.twilio.com/v1/Services/${service_uid}/Assets/${asset_uid}/Versions>'
console.log(url)

var contentType = "application/json"
var contentOpts = {
	filename: "mapping.json",
	contentType: contentType
}

form = new FormData();
form.append('Path', "mapping.json");
form.append('Visibility', "private");
form.append('Content', JSON.stringify(mapping), contentOpts);

await axios.post(url, form, {
	auth: {
		'user': client.accountSid,
		'pass': client.password
	}
});