I have done “Intro Labs” series for some products’ API in the past. Occasionally I was asked if there is a similar one for Field API or planning to make one. So here it is. I’m going to write about the introduction to Field API in the next few posts.
That being said, I should add a disclaimer before I proceed with writing; Field API is still under discussion about its supportability. We don’t have good documentation and samples, yet. For example, there is no comprehensive API samples like SDK Test Harness or Sample Web App for Glue. You will probably find some discrepancy in the current online documentation. (There is some historical reasons that we have the API which supports a certain set of functionalities. But this will be a different discussion.) We hope this will improve as the API matures in future. For the time being, we appreciate your patience.
Enough is said, let’s talk about the labs. The intro labs are intended to be exercises to learn Field API for people who is new to the File API. (If you happen to have used Glue API Intro, and View and Data API Intro labs that I wrote, the idea is exactly the same. In fact, I’m following the same format.)
At the time of this writing, the use of API for Field does not require API keys. Once you have an access to the product, you are ready to use API.
The labs include four incremental code projects. Starting from Lab 1, we learn the basics of Field API:
- Lab1 “Hello Field World” – this is THE minimum project which shows sign-in REST call. If you are new to the REST API, this lab will give you a pretty good picture of what REST API is like and how to use them.
- Lab2 “Field API Intro” – this lab shows how to retrieve project names and issues, and create a new issue.
- Lab3 “Field API Web Intro” – we then convert a client win forms application written in Lab 2 to a web application.
- Lab4 “Field API Web Intro Ex” – (extra bonus lab) we add a simple chart to report the number of issues.
Note that the last lab’s reporting functionality is not a part of Field API itself. I added this as I hear that reporting or “health monitoring” of a project is one of commonly discussed use case of Field API. (Apart from that, it also adds colors to the lab 🙂
All projects are minimum for clarity and focusing on understanding the logic of Field API for learning purposes. They are written in C#, ASP.NET. After the Lab4, the final application looks like below:
You can get the source code for each lab from here: Lab1 | Lab2 | Lab3 | Lab4
Additional References:
Here are a few links about Field API as reference. You may want to take a look to get a big picture:
- BIM 360 SDK: Part 1-BIM 360 Field API – detailed overview of Field API by Manu Venugopal
- BIM 360 Field API Doc – online reference doc for Field API
Next: Lab1 “Hello Field World”
Mikako
Hey Mikako!
These labs look amazing, however I am severely stuck on step one: logging in. And I have no idea why, despite using exactly the same login details as I do on the field website directly all I get is the response: Status Code: Unauthorized {“ticket”:null,”message”:””,”title”:””} (I’ve also had other people try there logins, including admin, no joy).
I appreciate that these labs are well over a year old but what be thankful for any advice!
LikeLike
Hi Daniel,
For troubleshooting, I would approach by testing REST call itself first by using a tool like Postman: https://www.getpostman.com/
I wrote a blog about this tool, too:
UI looks different now. But it’s quite intuitive how to use it. I cannot attach an image to this comment. So I will send it to you separately.
Once you verify that login works on postman, the problem is in your code (or my code if you are using the same project). Field API is REST, meaning that it has nothing to do with binary or build for Field web services. Login hasn’t changed. Please try it.
Also, for trouble shoot time discussion, Forum or Stack Overflow is more suited. I would appreciate if you use those. Sorry that things are less clear. Something we need to improve. In a mean time, I hope finally you are on the right community at least.
LikeLike