APIs & Integrations

MikeTeave
Membre

Files API (V3) : after is not working as expected in query parameters

I have been Hubspot Files api (v3) since months and using "after" to paginate to next page in responses - It was working fine but now when I use "after" we are getting empty results in response. I think there is some issue in API can you suggest any solutions?

0 Votes
1 Réponse
btara
Membre

Files API (V3) : after is not working as expected in query parameters

I am also faced the similar problem with telecombit.com but have solved out. You can also do it by changing with this code.

public any function getPost(required numeric postId, string order)
{
    switch(arguments.order)
    {
        case "new":
            arguments.order = "posts.createdAt DESC";
            break;
        case "old": 
            arguments.order = "posts.createdAt ASC";
            break;
        default:
            arguments.order = "posts.score DESC";
    }

    local.post = new Query(dataSource=variables.wheels.class.connection.datasource);
    local.post.setSql("
        SELECT *
        FROM
        WHERE posts.id = :postId OR posts.parentId = :postId
        ORDER BY posts.postTypeId ASC, :order"
    );

    local.post.addParam(name="postId", cfsqltype="cf_sql_integer", value=arguments.postId, maxlength=10);
    local.post.addParam(name="order", cfsqltype="cf_sql_varchar", value=arguments.order, maxlength=20);
    local.post = local.post.execute().getResult();

    return local.post;

 

0 Votes