Toplu işlemler gerçekleştirme
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Birden fazla işlem gerçekleştiriyorsanız tüm bu HTTP mesajlarının gönderilip alınmasının sürdüğü süre, uygulamanızı yavaşlatabilir ve yanıt vermemesini sağlayabilir. Toplu isteklerle, sunucunun tek bir HTTP isteğiyle birden fazla işlem yapmasını sağlayabilirsiniz. Temel fikir, bir kişi feed'i oluşturmanız ve gerçekleştirmek istediğiniz her işlem için bir giriş eklemenizdir.
Toplu istekler tek seferde 100 işlemle sınırlıdır. Toplu işlemler hakkında daha fazla bilgiyi Google Veri Protokolü'nde Toplu İşleme başlıklı makalede bulabilirsiniz.
Değişikliklerin e-posta adresine otomatik tamamlama özelliğine ve kişi yöneticisine yansıtılması 24 saati bulabilir.
Aşağıdaki kod örneğinde, 2 paylaşılan kişi oluşturan bir toplu istek gösterilmektedir. Ancak toplu isteği, kişileri sorgulamak, güncellemek ve silmek için de kullanabilirsiniz. Güncelleme ve silme girişlerinin iyimser eşzamanlılığın çalışması için bir düzenleme bağlantısı gerekir.
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom'
xmlns:gContact='http://schemas.google.com/contact/2008'
xmlns:gd='http://schemas.google.com/g/2005'
xmlns:batch='http://schemas.google.com/gdata/batch'>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/g/2008#contact' />
<entry>
<batch:id>1</batch:id>
<batch:operation type='insert' />
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/g/2008#contact'/>
<gd:name>
<gd:givenName>FIRST_NAME</gd:fullName>
<gd:familyName>LAST_NAME</gd:fullName>
</gd:name>
<gd:email rel='http://schemas.google.com/g/2005#home'
address='EMAIL_ADDRESS' primary='true'/>
</entry>
<entry>
<batch:id>2</batch:id>
<batch:operation type='insert' />
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/g/2008#contact'/>
<gd:name>
<gd:givenName>FIRST_NAME</gd:fullName>
<gd:familyName>LAST_NAME</gd:fullName>
</gd:name>
<gd:email rel='http://schemas.google.com/g/2005#home'
address='EMAIL_ADDRESS'
primary='true'/>
</entry>
</feed>
Aşağıdakini değiştirin:
FIRST_NAME
: Paylaşılan kişinin adı (ör. Ali).
LAST_NAME
: Paylaşılan kişinin soyadı (ör. Kim).
EMAIL_ADDRESS
: Paylaşılan kişinin tercih edilen e-posta adresi (ör. alk@gmail.com).
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-03-25 UTC.
[null,null,["Son güncelleme tarihi: 2025-03-25 UTC."],[],[],null,["# Perform batch operations\n\nIf you're performing several operations, the time it takes to send and receive\nall those HTTP messages can make your app slow and unresponsive. With batch\nrequests, you can have the server perform multiple operations with a single HTTP\nrequest. The basic idea is that you create a contacts feed and add an entry for\neach operation that you want to perform.\n\nBatch requests are limited to 100 operations at a time. You can find more\ninformation about batch operations in\n[Batch Processing in the Google Data Protocol](https://developers.google.com/gdata/docs/batch).\nChanges can take up to 24 hours to be reflected in the email address\nautocomplete and the contact manager.\n\nThe following code sample shows a batch request that creates 2 shared\ncontacts; however, you can also use a batch request to query, update, and delete\ncontacts. The update and delete entries require an edit link for\n[optimistic concurrency](https://developers.google.com/gdata/docs/1.0/reference#Optimistic-concurrency)\nto work. \n\n```xml\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003cfeed xmlns='http://www.w3.org/2005/Atom'\n xmlns:gContact='http://schemas.google.com/contact/2008'\n xmlns:gd='http://schemas.google.com/g/2005'\n xmlns:batch='http://schemas.google.com/gdata/batch'\u003e\n \u003ccategory scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/g/2008#contact' /\u003e\n \u003centry\u003e\n \u003cbatch:id\u003e1\u003c/batch:id\u003e\n \u003cbatch:operation type='insert' /\u003e\n \u003ccategory scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/g/2008#contact'/\u003e\n \u003cgd:name\u003e\n \u003cgd:givenName\u003eFIRST_NAME\u003c/gd:fullName\u003e\n \u003cgd:familyName\u003eLAST_NAME\u003c/gd:fullName\u003e\n \u003c/gd:name\u003e\n \u003cgd:email rel='http://schemas.google.com/g/2005#home'\n address='EMAIL_ADDRESS' primary='true'/\u003e\n \u003c/entry\u003e\n \u003centry\u003e\n \u003cbatch:id\u003e2\u003c/batch:id\u003e\n \u003cbatch:operation type='insert' /\u003e\n \u003ccategory scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/g/2008#contact'/\u003e\n \u003cgd:name\u003e\n \u003cgd:givenName\u003eFIRST_NAME\u003c/gd:fullName\u003e\n \u003cgd:familyName\u003eLAST_NAME\u003c/gd:fullName\u003e\n \u003c/gd:name\u003e\n \u003cgd:email rel='http://schemas.google.com/g/2005#home'\n address='EMAIL_ADDRESS'\n primary='true'/\u003e\n \u003c/entry\u003e\n\u003c/feed\u003e\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eFIRST_NAME\u003c/var\u003e: First name of the shared contact---for example, Alex.\n- \u003cvar translate=\"no\"\u003eLAST_NAME\u003c/var\u003e: The last name of the shared contact---for example, Kim.\n- \u003cvar translate=\"no\"\u003eEMAIL_ADDRESS\u003c/var\u003e: The preferred email address of the shared contact---for example, alk@gmail.com."]]