24
Views
7
Comments
I need API for add of county code in given screenshot format in ODC.
Question

Hello, 

My requirement for the API is as follows: In the dropdown, we need to display the country names in the format below, followed by the country flag. Additionally, the corresponding country code should be saved. 


Any suggestions or assistance would be greatly appreciated.

Thanks and regards,

Shashi Mishra


Screenshot 2025-01-27 173726.png
2023-02-19 05-11-08
Faais

Hi shashi, have you tried this Forge component? 

International Phone Input for ODC

2021-11-14 02-45-20
Shashi Mishra

Thank you Faais for quick reply.

Ok,sure.


2024-07-12 05-57-50
Gourav Shrivastava
Champion

Hello @Shashi Mishra 

Try this restcountries

https://restcountries.com/v3.1/all  

Example Response :- 

[

  {

    "name": { "common": "Afghanistan", "official": "Islamic Republic of Afghanistan" },

    "cca2": "AF",

    "cca3": "AFG",

    "flags": { "png": "https://flagcdn.com/w320/af.png", "svg": "https://flagcdn.com/af.svg" },

    "idd": { "root": "+9", "suffixes": ["3"] }

  },

  ...

]


2021-11-14 02-45-20
Shashi Mishra
2019-01-07 16-04-16
Siya
 
MVP

@Gourav Shrivastava Thanks for sharing this API.

@Shashi Mishra :  Instead of https://restcountries.com/v3.1/all  you can set specific fields you require. The details you can find at https://gitlab.com/restcountries/restcountries/-/blob/master/FIELDS.md 


2022-12-30 07-28-09
Navneet Garg

Rest API is good but Instead of using rest api you can create your own database table using following csv files. It will give you more control to handle the data and faster response.

https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv

https://github.com/datasets/country-codes/blob/main/data/country-codes.csv


2021-11-14 02-45-20
Shashi Mishra

Thank you @Navneet Garg 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.