<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Authentification problem using arcpy in ArcGIS Urban API Questions</title>
    <link>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093618#M6</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/118250"&gt;@MaximeDemers&lt;/a&gt;&amp;nbsp;and thank you for reaching out to us. You are right, the Urban API does use OAuth2.0 authentication method. Does it mean that your question above is no longer valid?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Aug 2021 15:20:49 GMT</pubDate>
    <dc:creator>AgnieszkaRozniak</dc:creator>
    <dc:date>2021-08-30T15:20:49Z</dc:date>
    <item>
      <title>Authentification problem using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093570#M4</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to use the Urban API with Python but I got an authentification error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GraphQL query failed with 1 errors&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[{'message': 'The access token provided is invalid or expired.', 'extensions': {'code': 'UNAUTHENTICATED'}}]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Im not sure why the token I provided to the urban api url is not working because it was generated using arcpy like below:&lt;/P&gt;&lt;PRE&gt;import arcpy
from sgqlc.operation import Operation
from sgqlc.endpoint.http import HTTPEndpoint
from urban_api_schema import urban_api_schema as schema

arcpy.SignInToPortal("https://www.arcgis.com", "myUserName", "MyPasswOrd")
#token is generated correctly
token = arcpy.GetSigninToken()
urban_api_url = "https://urban-api.arcgis.com/graphql" + '?token=' + token['token']

endpoint = HTTPEndpoint(urban_api_url)

#here it's the function that call the api to update the parcels
for parcel_chunk in parcels_chunks:
  op = Operation(schema.Mutation)
  create_parcels = op.create_parcels(urban_database_id="1c80e3e815594fd288d347e132138f0a", parcels=parcel_chunk)
  create_parcels.attributes.__fields__('global_id')

  json_data = endpoint(op)
  errors = json_data.get('errors')
  if errors:
    print(errors)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any helps would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Maxime Demers&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 13:47:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093570#M4</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2021-08-30T13:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Authentification problem using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093580#M5</link>
      <description>&lt;P&gt;Further readings make me realize that I must use a OAuth2.0 authentification method.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 14:07:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093580#M5</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2021-08-30T14:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Authentification problem using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093618#M6</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/118250"&gt;@MaximeDemers&lt;/a&gt;&amp;nbsp;and thank you for reaching out to us. You are right, the Urban API does use OAuth2.0 authentication method. Does it mean that your question above is no longer valid?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 15:20:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093618#M6</guid>
      <dc:creator>AgnieszkaRozniak</dc:creator>
      <dc:date>2021-08-30T15:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Authentification problem using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093619#M7</link>
      <description>&lt;P&gt;Yes ok, it can be deleted. Thank you for the feedback. Have a good day.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 15:21:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-urban-api-questions/authentification-problem-using-arcpy/m-p/1093619#M7</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2021-08-30T15:21:56Z</dc:date>
    </item>
  </channel>
</rss>

