DELETE /targets/{target_id} not working?

November 1, 2012 - 10:43am #1

I haven't changed this particular code in a couple of weeks, but it seems deleting a target recently stopped working, with HTTP 400:

GET /targets/4de2e4b9cf154d78bfe3baa6722ab952
{"result_code"=>"Success", "transaction_id"=>"fb1da348a8134c3ca5615e5807c652a0", "target_record"=>{"target_id"=>"4de2e4b9cf154d78bfe3baa6722ab952", "active_flag"=>true, "name"=>"REDACTED", "width"=>194.0, "tracking_rating"=>2, "reco_rating"=>""}, "status"=>"success"}
DELETE /targets/4de2e4b9cf154d78bfe3baa6722ab952
{"result_code"=>"Fail", "transaction_id"=>"bcd16bec92e644339ffe336044fe0053"}

The signature calculation code is identical between GET and DELETE

@ALL: just FYI: beside this

January 18, 2013 - 5:40am #16

@ALL: just FYI: beside this "beta" section, many threads to consult on CloudRecognition are here:

https://developer.vuforia.com/forum/ar-technical-discussion/cloud-recognition

 

Thanks. It's works.

January 17, 2013 - 11:25pm #15

Thanks. It's works.

No, you must set the

January 17, 2013 - 11:13pm #14

No, you must set the active_flag to false first.  You cannot delete a target that has the active_flag set to true, nor can you DELETE a target in the "processing" state.

DELETE method

January 17, 2013 - 11:10pm #13

Duane wrote:

When you set the "active_flag" to "false", the target goes into a "processing" state.  You need to wait for it to transition to "success" before you can issue the DELETE.

 

Can I call DELETE once? without first calling PUT (active_flag = false)?

Thanks

When you set the

January 17, 2013 - 11:07pm #12

When you set the "active_flag" to "false", the target goes into a "processing" state.  You need to wait for it to transition to "success" before you can issue the DELETE.

Hi, I can not remove the

January 17, 2013 - 11:04pm #11

Hi,

I can not remove the target from the server too.

I send PUT (active_flag = False), it bring back 200. It works. Then I use the DELETE method and vuforia returns a 500 error.

send: u'PUT /targets/f3a09c7f9bf84130b587924b00895e0e HTTP/1.1\r\nHost: vws.vuforia.com\r\nAccept-Encoding: identity\r\nContent-Length: 48\r\nDate: Fri, 18 Jan 2013 06:58:39 GMT\r\nContent-Type: application/json\r\nAuthorization: VWS b1c0a0d803ded780ca0b6a523d7da11c81ed0e3a:oWBGnjTM9sy5UGWK0tiEvGeJxAY=\r\n\r\n'
send: '{"active_flag": false, "name": "usuf306lt.jpeg"}'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: Apache-Coyote/1.1
header: Content-Type: application/json;charset=UTF-8
header: Transfer-Encoding: chunked
header: Date: Fri, 18 Jan 2013 06:58:40 GMT
{"result_code":"Success","transaction_id":"4682104a3e2545608fd346642686f57f"}

send: u'DELETE /targets/f3a09c7f9bf84130b587924b00895e0e HTTP/1.1\r\nHost: vws.vuforia.com\r\nAccept-Encoding: identity\r\nDate: Fri, 18 Jan 2013 06:58:41 GMT\r\nAuthorization: VWS b1c0a0d803ded780ca0b6a523d7da11c81ed0e3a:YSBFfOwTHsAAD/08pcn7RO95+HU=\r\n\r\n'
reply: 'HTTP/1.1 500 Internal Server Error\r\n'
header: Server: Apache-Coyote/1.1
header: Content-Type: application/json;charset=UTF-8
header: Transfer-Encoding: chunked
header: Date: Fri, 18 Jan 2013 06:58:42 GMT
header: Connection: close
{"result_code":"Fail","transaction_id":"16d8b7b3f2d14412b278964b8dfe0df3"}
 

Tell me how I can remove the target from the server through the API.

Thanks

DELETE /targets/{target_id} not working?

November 7, 2012 - 5:15pm #10

Sorry for the inconvenience. We'll update the forum as soon as provisioning is restored.

DELETE /targets/{target_id} not working?

November 7, 2012 - 3:30pm #9

I currently get an HTTP 200 to the PUT request to set the "active_flag" to false, and a subsequent GET shows the "active_flag" is indeed set to false, however, I now get an HTTP 500 on the DELETE.

This might be due to your load testing of the provisioning server.

UPDATE: sorry, just saw your update.  Yeah, that's a bit inconvenient.

DELETE /targets/{target_id} not working?

November 2, 2012 - 10:25am #8

OK - will you be able to take the two requests in immediate succession?

yes this should be possible

[EDIT - actually this is not possible.  You will need to poll for this because changing to inactive is classed as an update.  I am waiting on further advice and code samples here.  Thanks for your patience]

"This does seem like a curious requirement - a DELETE *could* be implemented to automatically deactivate the target first, since that's the obvious intent of the user and there cannot be any other interpretation of the request."

yes you are probably right, however it's more of a precaution at the moment on the server side to allow changes to propagate through.

appreciate your patience here.

N

 

DELETE /targets/{target_id} not working?

November 2, 2012 - 8:10am #7

OK - will you be able to take the two requests in immediate succession?

This does seem like a curious requirement - a DELETE *could* be implemented to automatically deactivate the target first, since that's the obvious intent of the user and there cannot be any other interpretation of the request.

DELETE /targets/{target_id} not working?

November 2, 2012 - 1:51am #6

After investigation, it turns out that there has been a recent update in the way DELETE requests are handled;

so from now on you will need to deactivate your target before deleting them (so, basically you need to send a PUT to update the target active flag to false, then send the DELETE afterwards).

 

DELETE /targets/{target_id} not working?

November 1, 2012 - 3:10pm #5

Yes, I'm using the correct verb in the signature calculation - if I weren't, presumably I would have gotten a 401 response, not a 400.  The calculation *code* is the same, though the data (including the verb) being fed into it is not.

As I mentioned, this exact code worked just fine a week or so ago.

I would appreciate you looking into this, since our TMS will get more and more out of sync with the stuff on your server.  We're already handling the serving of metadata ourselves due to the update problem mentioned in another thread.

DELETE /targets/{target_id} not working?

November 1, 2012 - 3:00pm #4

One note: you mention "the signature calculation code is identical between GET and DELETE"; 

this is true except that one signature input string will contain the "GET" verb, the other will contain the "DELETE" verb, so they are not strictly identical (though the calulcation is the same). 

So, I just want to be sure you double-check that...

Otherwise I can investigate that, let me know...

 

DELETE /targets/{target_id} not working?

November 1, 2012 - 2:50pm #3

I just tried it with another target, f63d69fe34994c4f9283ed77bd7789e6, from a completely different data set and it failed the same way.

DELETE /targets/{target_id} not working?

November 1, 2012 - 2:45pm #2

Hi, does that happen with one specific target (the one you reported below), or does it happen in general (i.e. have you also tried with other targets) ?

 

Log in or register to post comments