bic-org / Boxtech

Boxtech API is a global container database containing technical and safety information, such as tare weight, size/type and max stacking capacity for containers.
https://www.bic-boxtech.org
25 stars 7 forks source link

Endpoint for Owner ID #5

Closed 1linux closed 5 years ago

1linux commented 7 years ago

It would be nice to have an endpoint to get the cleartext name of an owners´s ID.

AltiusRupert commented 7 years ago

Hi Helmut, thanks for your inpu. Would you like to elaborate by describing your preferred scenario or use case for this requirement ?

BernierSFCloud commented 6 years ago

poke

ThorstenBruegge commented 5 years ago

don't know if it will help you. but if you get the content as a string (like here ) you can use this code to get every values from the endpoint separated:

            //  Ask if the container is found in dataBase
            if (bicData.ReasonPhrase == "OK")
            {
                //  Get content as string
                var containerDataString = await bicData.Content.ReadAsStringAsync();

                //  Get a list of JObjects out of the content string
                IEnumerable<JObject> objs = JsonConvert.DeserializeObject<List<JObject>>(containerDataString);

                //  Select the first JObject of the list
                JObject containerDataJObject = objs.FirstOrDefault();

                //  Assign values as string
                var tareKg  = containerDataJObject["tare_kg"].Value<string>();
                var tareLb  = containerDataJObject["tare_lbs"].Value<string>();
                var netKg   = containerDataJObject["max_payload_kg"].Value<string>();
                var netLb   = containerDataJObject["max_payload_lbs"].Value<string>();
                var maxKg   = containerDataJObject["max_gross_mass_kg"].Value<string>();
                var maxLb   = containerDataJObject["max_gross_mass_lbs"].Value<string>();
                var cubicM  = containerDataJObject["cubic_capacity_cbm"].Value<string>();
                var cubicFt = containerDataJObject["cubic_capacity_cuft"].Value<string>();

               // And so on...
            }

You get the full list of objects in the Swagger example.

AltiusRupert commented 5 years ago

Thanks Thorsten. Clearly, that's the idea and a quick way to deserialize the JSON container data.

@1linux , what is your use case to retrive the ownerId of the container ? Are you looking for information about the uploader ? The company which owns the container ? Other ?

bic-boxtech commented 5 years ago

@1linux im closing this issue due to the time, but if you need help please open a new issue and we will support you with this, the data you want is in the API.