POST
|
I would like to get a screenshot of a map (basemap with layers on top) without using the print server. Is that possible? Thanks!
... View more
12-18-2018
11:07 AM
|
0
|
11
|
243
|
POST
|
James, Perfect! We opted for option 2 where we can hit the endpoint sharing/rest/content/items/SurveyID/info/[name].xml I knew the XML file existed in the folder on my laptop. I didn't realize that endpoint existed. That makes it way easy to access the form definition. Thanks!
... View more
10-23-2018
11:24 AM
|
0
|
0
|
29
|
POST
|
I would like to get the question names for a Survey123 form using the REST API. What is the best way to do that? I found the following endpoint, which gets me close: https://www.arcgis.com/sharing/rest/content/items/[item_number]/info/[form_name].webform In the return object from the above endpoint I get a key-value pair where the key is "model" and the "value" is shown below. It looks like XML, but there is a "\n" on every line that is making it difficult for us to process. <Form_3 xmlns:esri=\"http://esri.com/xforms\" xmlns:jr=\"http://openrosa.org/javarosa\" xmlns:odk=\"http://www.opendatakit.org/xforms\" xmlns:orx=\"http://openrosa.org/xforms\" id=\"Form_3\">\n < starttime /> \n < AOMInitials /> \n < AOMOther /> \n < DailyScheduled /> \n < SpecialInspectionType /> \n < SpecialOther /> \n < SpecialLocation /> \n < endtime /> \n < meta > \n < instanceID /> \n </ meta > \n </ Form_3 > \n How can we convert that to standard XML/JSON? Is there a better endpoint we could use where we could get back the "model" in JSON or correctly formatted JSON? Thanks! Matt
... View more
10-18-2018
08:55 AM
|
0
|
2
|
166
|
POST
|
Hey Robert, Thanks for the quick response! We don't currently use a resource proxy and prefer not to. It is additional code to maintain and creates additional lag for every request. Is there an AGOL endpoint we can query directly to determine the remaining life of the token? Thanks, Matt
... View more
08-27-2018
10:58 AM
|
0
|
1
|
44
|
POST
|
I'm using OAuth to access private data on AGOL. Below is the Python code I'm running on my server: payload = { 'client_id' : config . UTILISYNC_ESRI_APP_CLIENT_ID , 'refresh_token' : refresh_token , 'grant_type' : 'refresh_token' , 'expiration' : 20160 } response = requests . post ( request_url , params = payload ) It executes successfully and I get a token that I can use to access the private AGOL data. However, the expiration I indicated is 2 weeks (20160), but the token expire after 30 or 40 minutes. What happens is I load the private services into my webpage using the Javascript API and the token I received from above. But after 30 or 40 minutes when I pan or zoom and the layer should be refreshed, instead I get an invalid token error on my console and the layer doesn't load. That is why I would like to know, is there a way I can get the expiration of the token? If I could submit the token to some endpoint and discover that token will actually expire sooner, then I will preemptively refresh the token before that happens. Also, if anyone has any ideas why my token isn't lasting 2 weeks like I think it should, that would be great to know too! Thanks!
... View more
08-27-2018
07:56 AM
|
0
|
3
|
569
|
POST
|
What is the best way to see if there are images attached to a survey and to determine which question they belong to? Below is an example... I created a test survey with 3 fields: name (name), before photo (photo) and after photo (photoafter). I submitted the form and received the attached webhook payload. In the payload I can see the name I entered in, but nothing about the attached images. I see I can make a call to: [serviceUrl] / [addResults id] / [uniqueId] /attachments?f=pjson&token= [token] to get information about the attachments for that object (see below). In the json object keywords contains the name of the feature attribute. Is using that endpoint and looking at keywords the best way to 1) see if there are any attachments to the survey and 2) to determine which question they belong to? Thanks, Matt { "attachmentInfos" : [ { "id" : 5, "globalId" : "3d424dd8-de4b-4273-a9ff-4c87010115e6", "parentGlobalId" : "63d210e7-aecd-4386-9e1b-77c04071d030", "name" : "broken-fire-hydrant-lying-sidewalk-46171082.jpg", "contentType" : "image/jpeg", "size" : 117352, "keywords" : "photo" }, { "id" : 6, "globalId" : "2f119743-a9e5-4ae4-845b-2c30c690964f", "parentGlobalId" : "63d210e7-aecd-4386-9e1b-77c04071d030", "name" : "Downtown_Charlottesville_fire_hydrant.jpg", "contentType" : "image/jpeg", "size" : 24352, "keywords" : "photoafter" } ] }
... View more
08-13-2018
10:16 AM
|
0
|
1
|
189
|
POST
|
James, That would be great if the layer ID could be provided in the webhook payload. For now, we will just look it up manually. Thanks for the quick responses! Matt
... View more
08-08-2018
02:32 PM
|
0
|
0
|
27
|
POST
|
James, Thanks for the quick reply! I see now how to manually look up the form_id. Is it possible to programmatically look up the form_id? Thanks again, Matt
... View more
08-08-2018
01:40 PM
|
0
|
2
|
27
|
POST
|
Hi James! So it sounds like I need to access the form definition and look up the form_id, then I will know with addResult to use. How can I programmatically look up the form_id in the form definition? I see form_id on the settings tab in the Connect Excel spreadsheet. It is blank on the few surveys that I created. Does a blank value mean the id is 0? Thanks, Matt
... View more
08-08-2018
11:28 AM
|
0
|
4
|
27
|
POST
|
This is an easy task if you don't have repeats. When you introduce repeats, you get multiple addResults that each have an attribute of uniqueId (see attached responseMult.py) and it is not easy to tell which one belongs to the main layer and which ones belong to related tables. In the case of the attached results, the uniqueId is 3. It is different if there are no repeats (see attached responseSingle.py). What logic can I use to write code that gets the correct uniqueId every time? Below are 3 approaches I'm considering. Approach 1 Use the addResults with id: 0. That is the case in the 2 attached examples. Is that always true? Does id: 0 always reference the main layer and subsequent ids represent related tables? If that is always the case, then that is pretty simple. Approach 2 If there is only 1 addResults then use the uniqueId of that addResults. If there is more than 1 addResults, then look up the parentglobalid in the adds and use that to lookup the globalId of the correct addResults. This is a little complicated, but should work. Approach 3 Use layerInfo to get the id of the correct addResults. I have results from a webhook from a while ago that included layerInfo attributes, which included, among other things, the id of the layer. For some reason that is not included in the webhook responses, we get now. Any thoughts on why? It seems like this would be the best approach if we could be could get it turned back on. Thoughts? Thanks so much!
... View more
08-06-2018
03:18 PM
|
0
|
6
|
97
|
Online Status |
Offline
|
Date Last Visited |
Thursday
|