311 API Go Live Update

3 views
Skip to first unread message

Dmitry Kachaev

unread,
Jul 1, 2009, 5:27:07 PM7/1/09
to OCTO Labs (DC Government)
Just want to give a quick update on 311 API Go Live.

We have our back-end integration figured out. We are now struggling
with integrating it into API without breaking interfaces.

It will take some time to implement it. There shouldn't be any
surprises, except errors will be handled with proper messages and HTTP
codes. API Key ("apikey" param) will be enforced.

I will be online most of the time till tomorrow, feel free to contact
me with your questions via Google Group, Twitter @octolabs, email/
GTalk firstname...@dc.gov or GVoice (202) 527-9423.

-Dmitry Kachaev

Dmitry Kachaev

unread,
Jul 1, 2009, 9:56:11 PM7/1/09
to OCTO Labs (DC Government)
Open 311 API is integrated into QC 311 backend env

example: http://api.dc.gov/open311/dev/submit.json - Development
environment (integrated with QC 311 env), feel free to test on it
example: http://api.dc.gov/open311/v1/submit.json - Production
environment, no tests allowed after July 1st

please note new parameter "servicecode" (for example "S0000")

-Dmitry
> GTalk firstname.lastn...@dc.gov or GVoice (202) 527-9423.
>
> -Dmitry Kachaev

Dmitry Kachaev

unread,
Jul 1, 2009, 10:05:21 PM7/1/09
to OCTO Labs (DC Government)
Also, important note
submit HTTP POST method expects Content-type application/x-www-form-
urlencoded

(AFAIK it means param1=value1&param2=value2 in POST body, where all
values are urlencoded (exact same syntax as GET query string))

-Dmitry

On Jul 1, 9:56 pm, Dmitry Kachaev <dmitry.kach...@gmail.com> wrote:
> Open 311 API is integrated into QC 311 backend env
>
> example:http://api.dc.gov/open311/dev/submit.json- Development
> environment (integrated with QC 311 env), feel free to test on it
> example:http://api.dc.gov/open311/v1/submit.json- Production

Shaun Farrell

unread,
Jul 1, 2009, 10:21:02 PM7/1/09
to OCTO...@googlegroups.com
I'm not getting a token back with /dev/ submit.json
--
---------------------------
Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/

Dmitry Kachaev (OCTO)

unread,
Jul 1, 2009, 10:26:20 PM7/1/09
to OCTO...@googlegroups.com
What is HTTP response code/message?

-Dmitry

Dmitry Kachaev, Director of R&D
Office of the CTO, DC Government

voice: (202) 527-9423
mail: dmitry....@dc.gov
location: One Judiciary Square, 930S
schedule: http://links.dc.gov/dk-freebusy
twitter: @octolabs
--
Check out our current projects: Apps for Democracy - http://appsfordemocracy.org, DC Open API - http://api.dc.gov, DC Circulator's "Where's my Bus?" - http://circulator.dc.gov

Shaun Farrell

unread,
Jul 1, 2009, 10:27:18 PM7/1/09
to OCTO...@googlegroups.com
I am getting this returned

string(1023) " "

Dmitry Kachaev

unread,
Jul 1, 2009, 10:31:03 PM7/1/09
to OCTO...@googlegroups.com
Can you send http packet or code snippet or list of all params?

Sent from my iPhone

Shaun Farrell

unread,
Jul 1, 2009, 10:34:42 PM7/1/09
to OCTO...@googlegroups.com
yeah using zend framework

$client = new Zend_Http_Client('http://api.dc.gov/open311/dev/submit.json');
$client->setMethod(Zend_Http_Client::POST);
        $client->setParameterPost(array(
            'apikey'  => $this->_open311Key,
            'servicecode' => 'S0471',
            'aid'   => $aid,
            'description' => $description
        ));
        $response = $client->request()->getBody();
        $data = Zend_Json::decode($response, Zend_Json::TYPE_OBJECT);

Shaun Farrell

unread,
Jul 1, 2009, 10:37:46 PM7/1/09
to OCTO...@googlegroups.com
here is a view of the $client object

object(Zend_Http_Client)#50 (15) {
["config:protected"]=>
array(9) {
["maxredirects"]=>
int(5)
["strictredirects"]=>
bool(false)
["useragent"]=>
string(16) "Zend_Http_Client"
["timeout"]=>
int(10)
["adapter"]=>
string(31) "Zend_Http_Client_Adapter_Socket"
["httpversion"]=>
string(3) "1.1"
["keepalive"]=>
bool(false)
["storeresponse"]=>
bool(true)
["strict"]=>
bool(true)
}
["adapter:protected"]=>
NULL
["uri:protected"]=>
object(Zend_Uri_Http)#62 (9) {
["_username:protected"]=>
string(0) ""
["_password:protected"]=>
string(0) ""
["_host:protected"]=>
string(10) "api.dc.gov"
["_port:protected"]=>
int(80)
["_path:protected"]=>
string(24) "/open311/dev/submit.json"
["_query:protected"]=>
string(0) ""
["_fragment:protected"]=>
string(0) ""
["_regex:protected"]=>
array(5) {
["escaped"]=>
string(16) "%[[:xdigit:]]{2}"
["unreserved"]=>
string(24) "[A-Za-z0-9-_.!~*'()\[\]]"
["segment"]=>
string(54) "(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])*"
["path"]=>
string(66) "(?:\/(?:(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])*)?)+"
["uric"]=>
string(56) "(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,])"
}
["_scheme:protected"]=>
string(4) "http"
}
["headers:protected"]=>
array(0) {
}
["method:protected"]=>
string(4) "POST"
["paramsGet:protected"]=>
array(0) {
}
["paramsPost:protected"]=>
array(4) {
["apikey"]=>
string(36) "531ef8d8-01df-4c44-b069-25e61af0f4d0"
["servicecode"]=>
string(5) "S0471"
["aid"]=>
string(6) "285822"
["description"]=>
string(10) "its vacant"
}
["enctype:protected"]=>
string(33) "application/x-www-form-urlencoded"
["raw_post_data:protected"]=>
NULL
["auth:protected"]=>
NULL
["files:protected"]=>
array(0) {
}
["cookiejar:protected"]=>
NULL
["last_request:protected"]=>
NULL
["last_response:protected"]=>
NULL
["redirectCounter:protected"]=>
int(0)

}



Everything looks good its a post, the fields are valid, urlencoded.

Shaun Farrell

unread,
Jul 1, 2009, 10:41:04 PM7/1/09
to OCTO...@googlegroups.com
Production seems to be working just fine.  I'll just use that without testing :-)

Dmitry Kachaev (OCTO)

unread,
Jul 1, 2009, 10:52:43 PM7/1/09
to OCTO...@googlegroups.com
Got it.

Dev was returning internal XML packet. Now in sync with Prod, and both returning valid token.

-Dmitry

Dmitry Kachaev, Director of R&D
Office of the CTO, DC Government

voice: (202) 527-9423
mail: dmitry....@dc.gov
location: One Judiciary Square, 930S
schedule: http://links.dc.gov/dk-freebusy
twitter: @octolabs
--
Check out our current projects: Apps for Democracy - http://appsfordemocracy.org, DC Open API - http://api.dc.gov, DC Circulator's "Where's my Bus?" - http://circulator.dc.gov


Shaun Farrell

unread,
Jul 1, 2009, 11:05:27 PM7/1/09
to OCTO...@googlegroups.com
Getting a new error in Dev
open311 submit method failed, backend 311 integration failed - strXMLData:

Dmitry Kachaev (OCTO)

unread,
Jul 1, 2009, 11:09:25 PM7/1/09
to OCTO...@googlegroups.com
Please, send HTTP POST details...

Dmitry Kachaev, Director of R&D
Office of the CTO, DC Government

voice: (202) 527-9423
mail: dmitry....@dc.gov
location: One Judiciary Square, 930S
schedule: http://links.dc.gov/dk-freebusy
twitter: @octolabs
--
Check out our current projects: Apps for Democracy - http://appsfordemocracy.org, DC Open API - http://api.dc.gov, DC Circulator's "Where's my Bus?" - http://circulator.dc.gov


Shaun Farrell

unread,
Jul 1, 2009, 11:09:28 PM7/1/09
to OCTO...@googlegroups.com
Also in /dev/

getFromToken.json is still returning serviceid of 123456

I think the json on the submit for the token may not be valid either.  I was unable to decode the json and had to do this manually.

Dmitry Kachaev (OCTO)

unread,
Jul 1, 2009, 11:15:25 PM7/1/09
to OCTO...@googlegroups.com
getFromToken works as intended, servicerequestids from dev are meaningless and can't be obtained using get method from production.

json token is fixed.

what are HTTP POST details on previous submit issue?

-Dmitry

Dmitry Kachaev, Director of R&D
Office of the CTO, DC Government

voice: (202) 527-9423
mail: dmitry....@dc.gov
location: One Judiciary Square, 930S
schedule: http://links.dc.gov/dk-freebusy
twitter: @octolabs
--
Check out our current projects: Apps for Democracy - http://appsfordemocracy.org, DC Open API - http://api.dc.gov, DC Circulator's "Where's my Bus?" - http://circulator.dc.gov


Shaun Farrell

unread,
Jul 1, 2009, 11:20:41 PM7/1/09
to OCTO...@googlegroups.com
I'm not sure about that other error i submitted with the xml error.  I  haven't gotten it again.

testing the json now.

Shaun Farrell

unread,
Jul 1, 2009, 11:23:05 PM7/1/09
to OCTO...@googlegroups.com
Here is one with the xml error

Error
string(1162) "{"error": "open311 submit method failed, backend 311 integration failed - strXMLData: \n \n \n \n \n \n \n \n \n \n \n "}"



Post
    string(6) "299772"

Shaun Farrell

unread,
Jul 1, 2009, 11:30:19 PM7/1/09
to OCTO...@googlegroups.com
The Production /v1/ is returning 123456 for the serviceid too!

I just tried to test it out and got service id 123456

Zvi Band

unread,
Jul 2, 2009, 9:25:34 AM7/2/09
to OCTO Labs (DC Government)
Dmitry,
Can you give us an update on the status of the API? I tested my
application by posting a real service request (I actually had a
legitimate need!) and it seemed to go through.

On Jul 1, 11:30 pm, Shaun Farrell <farrel...@gmail.com> wrote:
> The Production /v1/ is returning 123456 for the serviceid too!
>
> I just tried to test it out and got service id 123456
>
> >>> mail: dmitry.kach...@dc.gov
> >>> location: One Judiciary Square, 930S
> >>> schedule:http://links.dc.gov/dk-freebusy
> >>> twitter: @octolabs
> >>> --
> >>> Check out our current projects: Apps for Democracy -
> >>>http://appsfordemocracy.org, DC Open API -http://api.dc.gov, DC
> >>> Circulator's "Where's my Bus?" -http://circulator.dc.gov
>
> >>> On Wed, Jul 1, 2009 at 11:09 PM, Shaun Farrell <farrel...@gmail.com>wrote:
>
> >>>> Also in /dev/
>
> >>>> getFromToken.json is still returning serviceid of 123456
>
> >>>> I think the json on the submit for the token may not be valid either.  I
> >>>> was unable to decode the json and had to do this manually.
>
> >>>> On Wed, Jul 1, 2009 at 11:05 PM, Shaun Farrell <farrel...@gmail.com>wrote:
>
> >>>>> Getting a new error in Dev
> >>>>> open311 submit method failed, backend 311 integration failed -
> >>>>> strXMLData:
>
> >>>>> On Wed, Jul 1, 2009 at 10:52 PM, Dmitry Kachaev (OCTO) <
> >>>>> dmitry.kach...@dc.gov> wrote:
>
> >>>>>> Got it.
> >>>>>> Dev was returning internal XML packet. Now in sync with Prod, and both
> >>>>>> returning valid token.
>
> >>>>>> -Dmitry
>
> >>>>>> Dmitry Kachaev, Director of R&D
> >>>>>> Office of the CTO, DC Government
>
> >>>>>> voice: (202) 527-9423
> >>>>>> mail: dmitry.kach...@dc.gov
> >>>>>> location: One Judiciary Square, 930S
> >>>>>> schedule:http://links.dc.gov/dk-freebusy
> >>>>>> twitter: @octolabs
> >>>>>> --
> >>>>>> Check out our current projects: Apps for Democracy -
> >>>>>>http://appsfordemocracy.org, DC Open API -http://api.dc.gov, DC
> >>>>>> Circulator's "Where's my Bus?" -http://circulator.dc.gov
>
> >>>>>> On Wed, Jul 1, 2009 at 10:41 PM, Shaun Farrell <farrel...@gmail.com>wrote:
>
> >>>>>>> Production seems to be working just fine.  I'll just use that without
> >>>>>>> testing :-)
>
> >>>>>>>> On Wed, Jul 1, 2009 at 10:34 PM, Shaun Farrell <farrel...@gmail.com
> >>>>>>>> > wrote:
>
> >>>>>>>>> yeah using zend framework
>
> ...
>
> read more »

Dmitry Kachaev (OCTO)

unread,
Jul 2, 2009, 9:28:10 AM7/2/09
to OCTO...@googlegroups.com
We are switching http://api.dc.gov/open311/v1/submit.json to point to production today. http://api.dc.gov/open311/dev/submit.json can be used to test submit functionality, it goes to QC env and can be used for testing.

-Dmitry

Dmitry Kachaev, Director of R&D
Office of the CTO, DC Government

voice: (202) 527-9423

location: One Judiciary Square, 930S
schedule: http://links.dc.gov/dk-freebusy
twitter: @octolabs
--
Check out our current projects: Apps for Democracy - http://appsfordemocracy.org, DC Open API - http://api.dc.gov, DC Circulator's "Where's my Bus?" - http://circulator.dc.gov

Zvi Band

unread,
Jul 7, 2009, 9:00:05 AM7/7/09
to OCTO Labs (DC Government)
I'm still getting 123456 for the Service ID...

On Jul 2, 9:28 am, "Dmitry Kachaev (OCTO)" <dmitry.kach...@dc.gov>
wrote:
> We are switchinghttp://api.dc.gov/open311/v1/submit.jsonto point to
> production today.http://api.dc.gov/open311/dev/submit.jsoncan be used to
> test submit functionality, it goes to QC env and can be used for testing.
> -Dmitry
>
> Dmitry Kachaev, Director of R&D
> Office of the CTO, DC Government
>
> voice: (202) 527-9423
> mail: dmitry.kach...@dc.gov
> location: One Judiciary Square, 930S
> schedule:http://links.dc.gov/dk-freebusy
> twitter: @octolabs
> --
> Check out our current projects: Apps for Democracy -http://appsfordemocracy.org, DC Open API -http://api.dc.gov, DC
> Circulator's "Where's my Bus?" -http://circulator.dc.gov
>
> ...
>
> read more »

Dmitry Kachaev

unread,
Jul 7, 2009, 1:08:58 PM7/7/09
to OCTO...@googlegroups.com
It is integrated through now.

submit will return UUID (temp token) which you can exchange for servicerequestid using getFromToken method, while service request is not propagated through the system it will return empty servicerequestid (empty string).

Dev "submit" returns servicerequestid from QC env. (doesn't match actual service requests, but you can see how it works through the whole workflow).

-Dmitry

p.s. Judging will be in process from 3pm to 5pm. Let me know if you have any issues. My # 202 527 9423

Dmitry Kachaev
cell    - (703) 477-6072
email - dmitry....@gmail.com

Shaun Farrell

unread,
Jul 30, 2009, 9:05:24 PM7/30/09
to OCTO Labs (DC Government)
It seems like the 311 API is not working. I can submit a request and
get a Token but the tokens never turn into service ids.
Is the 311 api integrated yet? Anyone else having problems?

If the issue hasn't been accepted as a service id is there a way to
notify the user?



On Jul 7, 1:08 pm, Dmitry Kachaev <dmitry.kach...@gmail.com> wrote:
> It is integrated through now.
> submit will return UUID (temp token) which you can exchange for
> servicerequestid using getFromToken method, while service request is not
> propagated through the system it will return empty servicerequestid (empty
> string).
>
> Dev "submit" returns servicerequestid from QC env. (doesn't match actual
> service requests, but you can see how it works through the whole workflow).
>
> -Dmitry
>
> p.s. Judging will be in process from 3pm to 5pm. Let me know if you have any
> issues. My # 202 527 9423
>
> Dmitry Kachaev
> cell    - (703) 477-6072
> email - dmitry.kach...@gmail.com
>
> On Tue, Jul 7, 2009 at 9:00 AM, Zvi Band <skee...@gmail.com> wrote:
>
> > I'm still getting 123456 for the Service ID...
>
> > On Jul 2, 9:28 am, "Dmitry Kachaev (OCTO)" <dmitry.kach...@dc.gov>
> > wrote:
> > > We are switchinghttp://api.dc.gov/open311/v1/submit.jsontopoint to
> > > production today.http://api.dc.gov/open311/dev/submit.jsoncanbe used to
> > > test submit functionality, it goes to QC env and can be used for testing.
> > > -Dmitry
>
> > > Dmitry Kachaev, Director of R&D
> > > Office of the CTO, DC Government
>
> > > voice: (202) 527-9423
> > > mail: dmitry.kach...@dc.gov
> > > location: One Judiciary Square, 930S
> > > schedule:http://links.dc.gov/dk-freebusy
> > > twitter: @octolabs
> > > --
> ...
>
> read more »

Dmitry Kachaev (OCTO)

unread,
Aug 3, 2009, 3:35:36 PM8/3/09
to OCTO...@googlegroups.com
We are looking at this issue. We are on somewhat manual integration right now, waiting for new 311 system to come online.

I will check and reply by tomorrow on this.

-Dmitry

Dmitry Kachaev, Director of R&D
Office of the CTO, DC Government

voice: (202) 527-9423

location: One Judiciary Square, 930S
schedule: http://links.dc.gov/dk-freebusy
twitter: @octolabs
--
Check out our current projects: Apps for Democracy - http://appsfordemocracy.org, DC Open API - http://api.dc.gov, DC Circulator's "Where's my Bus?" - http://circulator.dc.gov
Sent from Washington, District of Columbia, United States
Reply all
Reply to author
Forward
0 new messages