Ir al contenido
v2.7

Obtener bandera del país

You can use this endpoint to show different country flags icons to your users.

GET/avatars/flags/{code}Alcance avatars.read

You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the ISO 3166-1 standard.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

code Flag obligatorio

Country Code. ISO Alpha-2 country code format. Valores: af, ao, al, ad, ae, ar, am, ag, au, at, az, bi, be, bj, bf, bd, bg, bh, bs, ba, by, bz, bo, br, bb, bn, bt, bw, cf, ca, ch, cl, cn, ci, cm, cd, cg, co, km, cv, cr, cu, cy, cz, de, dj, dm, dk, do, dz, ec, eg, er, es, ee, et, fi, fj, fr, fm, ga, gb, ge, gh, gn, gm, gw, gq, gr, gd, gt, gy, hn, hr, ht, hu, id, in, ie, ir, iq, is, il, it, jm, jo, jp, kz, ke, kg, kh, ki, kn, kr, kw, la, lb, lr, ly, lc, li, lk, ls, lt, lu, lv, ma, mc, md, mg, mv, mx, mh, mk, ml, mt, mm, me, mn, mz, mr, mu, mw, my, na, ne, ng, ni, nl, no, np, nr, nz, om, pk, pa, pe, ph, pw, pg, pl, pf, kp, pt, py, qa, ro, ru, rw, sa, sd, sn, sg, sb, sl, sv, sm, so, rs, ss, st, sr, sk, si, se, sz, sc, sy, td, tg, th, tj, tm, tl, to, tt, tn, tr, tv, tz, ug, ua, uy, us, uz, va, vc, ve, vn, vu, ws, ye, za, zm, zw.

width number

Image width. Pass an integer between 0 to 2000. Defaults to 100.

height number

Image height. Pass an integer between 0 to 2000. Defaults to 100.

quality number

Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

200Éxito
400Parámetro inválido o faltante
401Sin sesión, sin permiso en el recurso o clave sin el alcance
404Recurso de la ruta no encontrado
429Límite de peticiones

Todo error llega como JSON con code, type y message: consulta Errores.

import { Client, Avatars, Flag } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getFlag({
code: Flag.Afghanistan,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
});
console.log(result);
Respuesta200 OK

Sin cuerpo en la respuesta.


Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.

¿Te ayudó esta página?