Although I don’t work in road ecology or traffic engineering, the author somehow pulled me through 300 pages on this topic. He managed this not just through vivid language and diction, but by personally visiting places and telling stories about the specific challenges that animals, “carers,” forest service workers, and others faced as freeways and highways bisected and dissected their environments.
To use an analogy, suppose you’re a barista making espresso coffee. An AGI-capable robot trained as a barista is able to make all the coffee that a regular barista can make but twice as fast. Further, the Android barista can create exquisite espresso art in any shape that humans request, wowing them and making the experience novel. Soon the human barista is replaced. After all, the paying customer would rather pay $2.50 for a robot to make a latte instead of $5.00, especially when it tastes the same.
Most code samples in documentation are fairly basic, which is by design. Documentation tries to show the most common use of the API, not advanced scenarios for an enterprise-grade app whose complexity would easily overwhelm developers. (At that point, you end up with a sample app.)
With AI tools built directly into your authoring tool or IDE (such as VS Code), fixing simple doc bugs can become a mechanical, click-button task. Here’s the approach to fixing simple doc bugs:
(Note: The fact that I’m writing a book review on this topic might seem odd given that I usually focus on tech comm topics. However, I document APIs for getting map data into cars, so I sometimes read books related to the automotive and transportation domain. I also run a book club at work focused on these books.)
During the past few weeks, I’ve felt like my brain’s RPMs have been in the red zone. Granted, the constant stream of chaotic political news hasn’t helped—but regardless of current political events, I’m frequently checking the news, my email, and chat messages and operating in a mode that isn’t great. Reading long-form books has proven to be difficult. I run a book club at work focused on automotive and transportation books, and it took me two months to make it through a single book (granted, it was a 300-page historically dense book, but still).
“Biohacking” might be a pretentious cyber term for what is otherwise a straightforward experiment. For 10 days, I tracked my food and exercise levels while also wearing a continuous glucose monitor (CGM) to track my glucose levels. I then used AI to pair up the food + exercise with the glucose readings and perform an analysis about triggers for glucose spikes and recommendations to avoid them.
I want you to act as my AI stream journal (similar to a bullet journal), for the day. In this chat session, I’ll log 3 kinds of notes: tasks, thoughts, and events. Tasks are to-do list items. Thoughts are random ideas or notes I have. Events consist of food eaten, exercise, or descriptions of my internal states. The point is to have an easy way to dump all the scattered information in my head into a central log that you organize and analyze on my behalf.
In this section, you’ll use curl to make the same weather API requests you made previously with Postman. If you haven’t installed curl, see curl intro and installation first.
Activity: Make the OpenWeatherAPI request using curl
This activity assumes you have curl installed. curl is available on Mac and some Windows 10 versions by default. If you’re on an older Windows machine that doesn’t have curl, see installing curl here for details. (Most likely, choose “With Administrator Privileges (free)” 64-bit version.) Close and restart your Command Prompt after installing curl.
To make a request with curl:
Assuming you completed the exercises in the Postman tutorial, go back into Postman.
On any request you’ve configured, below the Save button in Postman, click the Code link. (If you don’t see the link, scroll up.)
In the Generate Code Snippets dialog box, select cURL from the drop-down list, and then click Copy to Clipboard.
curl request in Postman
The Postman code for the OpenWeatherMap weather request in curl looks as follows:
curl --location--request GET 'https://api.openweathermap.org/data/2.5/weather?zip=95050&units=imperial&appid=APIKEY'
(In the above code, replace APIKEY with your actual API key.)
The --location parameter will prompt curl to submit a new request if the URL is a redirect. The --request parameter specifies the operation for the request.
(Note that previously, Postman would include its own header information, designated with -H. If you see these parameters, delete them since they cause issues when submitted outside of Postman.)
In general, the code snippets can be copied and pasted directly into your terminal on a Mac. However, for Windows, you must change the single quotation marks to double quotation marks.
Also, on Windows, if your curl has any backslashes, (\) remove them and put all content onto the same line. (Backslashes are just added for readability). You can make these adjustments in a text editor before pasting the curl command into the Command Prompt.
Go to your Terminal (Mac) or Command Prompt (Windows).
You can open your Terminal / Command Prompt by doing the following:
If you’re on Windows, go to Start and search for cmd to open up the Command Prompt. Paste in the curl request and then press Enter. (If you can’t paste it in, look for paste options on the right-click menu.)
If you’re on a Mac, open Terminal by pressing Cmd + spacebar and typing Terminal. (Or go to Applications > Utilities > Terminal). (You could also use iTerm.) Paste in the curl request and then press Enter.
The response from the OpenWeatherMap weather request should look as follows:
This response is minified. You can un-minify it by going to a site such as JSON pretty print, or if you have Python installed, you can add | python -m json.tool at the end of your cURL request to un-minify the JSON in the response (see this Stack Overflow thread for details).
Note about single and double quotes with Windows curl requests
If you’re using Windows to submit a lot of curl requests, and the curl requests require you to submit JSON in the request body, you might run into issues with single versus double quotes. The problem is that request body content is often formatted in JSON, which requires double quotes.
Since you can’t use double quotes inside of other double quotes, you’ll run into issues in submitting curl requests in these scenarios.
Here’s the workaround. If you have to submit body content in JSON, you can store the content in a JSON file. Then you reference the file with an @ symbol, like this:
curl -H"Content-Type: application/json"-H"Authorization: 123"-X POST -d @mypostbody.json http://endpointurl.com/example
Here curl will look in the existing directory for the mypostbody.json file. (You can also reference the complete path to the JSON file on your machine.)
About Tom Johnson
I'm an API technical writer based in the Seattle area. On this blog, I write about topics related to technical writing and communication — such as software documentation, API documentation, AI, information architecture, content strategy, writing processes, plain language, tech comm careers, and more. Check out my API documentation course if you're looking for more info about documenting APIs. Or see my posts on AI and AI course section for more on the latest in AI and tech comm.
If you're a technical writer and want to keep on top of the latest trends in the tech comm, be sure to subscribe to email updates below. You can also learn more about me or contact me. Finally, note that the opinions I express on my blog are my own points of view, not that of my employer.