Mulai
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Google API digunakan dari project Google Cloud. Panduan ini membahas
proses pembuatan Project Google Cloud, mengaktifkan OR API dalam
project, dan mendapatkan kunci API untuk memanggil endpoint API.
Membuat project Google Cloud
Menggunakan akun yang dihosting Google,
buat
project di Konsol Google Cloud. Jika pemecah masalah yang ingin Anda gunakan adalah
dalam program penguji tepercaya, ikuti petunjuk
guide terlebih dahulu.
Mengaktifkan API
Mendapatkan kunci API
{
"key": "your_api_key"
}
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-08-29 UTC.
[null,null,["Terakhir diperbarui pada 2024-08-29 UTC."],[[["\u003cp\u003eGoogle Cloud projects are necessary to utilize Google APIs, and this guide outlines the setup process for accessing the Optimization Routing API (OR API).\u003c/p\u003e\n"],["\u003cp\u003eThe process involves three main steps: creating a Google Cloud project, enabling the OR API within the project, and generating an API key for authentication.\u003c/p\u003e\n"],["\u003cp\u003eBefore proceeding, ensure you have a Google account, and if utilizing a solver under a trusted tester program, refer to the provided guide for specific instructions.\u003c/p\u003e\n"],["\u003cp\u003eOnce enabled, you'll need to obtain an API key through the Google Cloud console and securely store it in a 'credentials.json' file for API access.\u003c/p\u003e\n"]]],["The process involves three core steps: creating a Google Cloud project, enabling the OR API within that project, and obtaining an API key. First, create a project via the Google Cloud console. Second, enable the OR API by navigating to the APIs library and clicking \"Enable.\" Finally, generate an API key through the credentials menu, saving it to a `credentials.json` file with the specified format. This API key is needed to call the API endpoints.\n"],null,["# Get started\n\nGoogle APIs are consumed from Google Cloud projects. This guide walks through\nthe process of creating a Google Cloud Project, enabling the OR API in such a\nproject, and obtaining an API key to call the API endpoints.\n\n1. Create a Google Cloud project\n\n Using a Google hosted account,\n [create](https://console.cloud.google.com/projectcreate)\n a project in the Google Cloud console. If the solver you intend to use is\n under a trusted tester program, follow this\n [guide](/optimization/service/trusted_testers) first.\n2. Enable the API\n\n - Navigate to the [APIs\n library](https://console.cloud.google.com/apis/library/optimization.googleapis.com).\n\n - Click \"Enable\".\n\n3. Get an API key\n\n - Navigate to the\n [credentials](https://console.cloud.google.com/apis/credentials)\n menu.\n\n - Click \"+ CREATE CREDENTIALS\"\n\n - Select API key\n\n - Save the API key in a `credentials.json` file with the following body\n\n {\n \"key\": \"your_api_key\"\n }"]]