首页 > 解决方案 > Here Batch Geocode API - Batch 停留在提交状态

问题描述

我已经向 Here.com 提交了一份工作到 Geocode 5 地址。我使用 Postman 使用 POST 请求提交。我在星期三提交,现在是星期五,我检查时的状态仍然是“提交”。

这是我使用的api请求:

https://batch.geocoder.api.here.com/6.2/jobs?app_id=ID&app_code=CODE&mailto=billtepe@gmail.com&outdelim=|&outcols=displayLatitude,displayLongitude,locationLabel,houseNumber,street,district,city,postalCode,county,state,country&indelim=|

数据:

recId|searchText|country
1|1 BRAID WAY TAYLOR MILL KY 41011|USA
2|1 GEORGETOWN FORT MITCHELL KY 41017|USA
3|1 SPERTI DR  KY|USA
4|10 E. 29TH ST. TAYLOR MILL KY 41015|USA
5|1000 W 33RD ST LATONIA KY 41015|USA

回复我回来了:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:SearchBatch xmlns:ns2="http://www.navteq.com/lbsp/Search-Batch/1">
    <Response>
        <MetaInfo>
            <RequestId>bEmNvFu9M7AVaISeEYvrT4cYMlj29Y8K</RequestId>
        </MetaInfo>
        <Status>submitted</Status>
        <TotalCount>0</TotalCount>
        <ValidCount>0</ValidCount>
        <InvalidCount>0</InvalidCount>
        <ProcessedCount>0</ProcessedCount>
        <PendingCount>0</PendingCount>
        <SuccessCount>0</SuccessCount>
        <ErrorCount>0</ErrorCount>
    </Response>
</ns2:SearchBatch>

这是我通过 POSTMAN 提交以检查状态的 GET 请求:

https://batch.geocoder.api.here.com/6.2/jobs/bEmNvFu9M7AVaISeEYvrT4cYMlj29Y8K?app_id=ID&app_code=CODE&action=status

这是我 2.5 天以来收到的回复。这需要多长时间?我是这里的新手,只是不知道我的期望应该是什么。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:SearchBatch xmlns:ns2="http://www.navteq.com/lbsp/Search-Batch/1">
    <Response>
        <MetaInfo>
            <RequestId>bEmNvFu9M7AVaISeEYvrT4cYMlj29Y8K</RequestId>
        </MetaInfo>
        <Status>submitted</Status>
        <TotalCount>0</TotalCount>
        <ValidCount>0</ValidCount>
        <InvalidCount>0</InvalidCount>
        <ProcessedCount>0</ProcessedCount>
        <PendingCount>0</PendingCount>
        <SuccessCount>0</SuccessCount>
        <ErrorCount>0</ErrorCount>
    </Response>
</ns2:SearchBatch>

任何帮助或指导将不胜感激。

标签: here-api

解决方案


不幸的是,您没有通过在 POST 请求中添加“&action=run”来开始这项工作。请查看https://developer.here.com/documentation/batch-geocoder/topics/submit-batch-request.html上的文档

您可以通过发送带有该操作的 PUT 请求来单独启动作业。然后该作业将变为状态“接受”。只有这样它才会排队等待执行:

https://batch.geocoder.api.here.com/6.2/jobs/bEmNvFu9M7AVaISeEYvrT4cYMlj29Y8K?app_id=ID&app_code=CODE&action=run

推荐阅读