GET Program Name by REST API Tag Type

Jay00031987
Level 4

GET Program Name by REST API Tag Type

Business use case is to get Program ID details via REST API by using this call https://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Programs/getP...

But need few details regarding below questions

 

1. In response JSON, sequence will be either ascending or descending or in random order or is there way to sort it based on dateTime

 

2. In Marketo, if program created is more than 200 with tag type, then maxReturn value 200 can be managed by offset query

 

Have anyone have done this in their project?

 

 

 

Jay
5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: GET Program Name by REST API Tag Type

1. The order is indeterminate from the client side.

 

2. Yes? Don't know what your precise question is... offset and maxReturn work together but I wouldn't say they "manage" each other.

Jay00031987
Level 4

Re: GET Program Name by REST API Tag Type

Hi @SanfordWhiteman 

 

When you say offset and maxReturn work together that mean if program is more than 200 lets say 300 program then offset value will be changed from 1 to 2. is it correct?

 

Jay
SanfordWhiteman
Level 10 - Community Moderator

Re: GET Program Name by REST API Tag Type


When you say offset and maxReturn work together that mean if program is more than 200 lets say 300 program then offset value will be changed from 1 to 2. is it correct?

 


No, the offset is the count of items, not count of pages. To get the second page with results 201-300, the offset is 201.

rajmodi
Level 2

Re: GET Program Name by REST API Tag Type

This is great info!

Is there a way to find out total number of assets such as forms, emails, programs, etc. first so it's easier to make offset call along with maxReturn? Also, what tools, besides Postman, do you use to pull all the assets via REST API?

SanfordWhiteman
Level 10 - Community Moderator

Re: GET Program Name by REST API Tag Type


Is there a way to find out total number of assets such as forms, emails, programs, etc. first so it's easier to make offset call along with maxReturn?

No, there isn’t.

 


Also, what tools, besides Postman, do you use to pull all the assets via REST API?

Postman is fundamentally a testing tool. Though it can be scripted to get production-ready results, you need to write actual code to consume the API properly.

 

Though there are some prefab apps out there like CData‘s that you might try, they all have fundamental flaws b/c they’re not coded by people who are full-time Marketo admins, so the results aren’t always accurate.