• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to access API with arguments?

Enthusiast ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

This is the API page Reports.getInactivePages (Method)  and this is how to invoke the API Invoking the API Using ColdFusion . However, I want to use the QueryRowLimit=0 to return all the records. This is what I have.

<cfset inactivePagesReport = Server.CommonSpot.api.getObject('reports')>

<cfset inactivePages = inactivePagesReport.getInactivePages(0)>

<cfset records = inactivePages.QueryRowLimit = 0 >

<cfdump var="#records#" >

This is not working. It got this error: Attempt to add a field to a locked structure of type 'Reports_GetInactivePages_Result'

Views

444

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Dec 11, 2017 Dec 11, 2017

I haven't used Commonspot in over a decade so I am not sure how much help I can be.  It looks like on line 2 you are making the call and getting your result set, but then on line 3 you are trying to add a limiter to that result set.  According to the docs you provided, a correct call would look similar to the following:

<cfset inactivePagesReport = Server.CommonSpot.api.getObject('reports')>

<cfset inactivePages = inactivePagesReport.getInactivePages(userId=0, limit=0)>

<cfdump var="#inactivePages#

...

Votes

Translate

Translate
Engaged ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

I haven't used Commonspot in over a decade so I am not sure how much help I can be.  It looks like on line 2 you are making the call and getting your result set, but then on line 3 you are trying to add a limiter to that result set.  According to the docs you provided, a correct call would look similar to the following:

<cfset inactivePagesReport = Server.CommonSpot.api.getObject('reports')>

<cfset inactivePages = inactivePagesReport.getInactivePages(userId=0, limit=0)>

<cfdump var="#inactivePages#" >

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

LATEST

nc_tunney, super awesome! Thank you. It works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation