Opportunities Api 2.1 works wrongly and 2.2 does not have orderby

When I bring Opportunities using 2.1/Opportunities CUSTOMFIELDS are fed partially and 2.2 API shows correctly the record but this version has eradicated orderby (imprescindible for us to integrate with our ERP)

Please.. I need help 

 

Example: 

"OPPORTUNITY_ID": 10122780,
"OPPORTUNITY_NAME": "Mister J",
.....

 "CUSTOMFIELDS": [
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_5",
"FIELD_VALUE": "Spain"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_6",
"FIELD_VALUE": "A Coruña"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_7",
"FIELD_VALUE": "es"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_8",
"FIELD_VALUE": "Pets"
}
]

If I retrieve using 2.2/Opportunities  it shows all the CUSTOMFIELDS

"OPPORTUNITY_ID": 10122780,
"OPPORTUNITY_NAME": "Mister J",
.....

"CUSTOMFIELDS": [
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_1",
"FIELD_VALUE": 854
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_11",
"FIELD_VALUE": "false"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_14",
"FIELD_VALUE": "https://www.facebook.com/MisterJdog/"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_5",
"FIELD_VALUE": "Spain"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_16",
"FIELD_VALUE": "https://twitter.com/MisterJ_dog"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_2",
"FIELD_VALUE": "http://bloombees.com/misterj"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_6",
"FIELD_VALUE": "A Coruña"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_9",
"FIELD_VALUE": "true"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_10",
"FIELD_VALUE": "true"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_13",
"FIELD_VALUE": "https://www.instagram.com/misterj_dog/"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_7",
"FIELD_VALUE": "es"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_8",
"FIELD_VALUE": "Pets"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_15",
"FIELD_VALUE": "http://misterjdog.com/"
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_3",
"FIELD_VALUE": 1
},
{
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_17",
"FIELD_VALUE": "true"
}
]

1

Comments

1 comment
  • Hello Adrian,

    Thank you for notifying us of the ordering bug, I've created a ticket for the issue.

    A work around for this problem could be done using the v2.2 API CustomFields endpoint to get the custom field metadata (this would contain useful information such as ORDER_ID, GROUP_ID and FIELD_FOR for all of the custom fields that have been defined).

    Inside your app, the returned metadata can be filtered by FIELD_FOR == "OPPORTUNITY", then group by the GROUP_ID, and order by the ORDER_ID.  

    With the metadata filtered and sorted to your liking, use the Opportunities endpoint to get your Opportunity as usual, and the correct positions of the custom fields can now be derived from the metadata.

    I hope this solution will help you with your current issue.

     

    Regards,

    Sung

    0
    Comment actions Permalink

Please sign in to leave a comment.