Jump to content


Photo

API Call to Add/Complete Process Stages


  • Please log in to reply
10 replies to this topic

#1 Success

Success

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 10 August 2020 - 10:08 AM

We are trying to add contacts from our lead generation process into X2CRM using the API and would like to start them on a process/stage but we are not sure how to do this using the API.

Is this part of the Actions?

Thanks in advance.



#2 jack

jack

    Admin

  • Administrators
  • 61 posts

Posted 10 August 2020 - 11:31 AM

Hi Success,
You can put user on the process/stage by using the workflows. You can have it so when a record is created it will starts them on a stage. 
-Jack



#3 Success

Success

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 11 August 2020 - 01:47 AM

Hi Success,
You can put user on the process/stage by using the workflows. You can have it so when a record is created it will starts them on a stage. 
-Jack

 

Hey Jack,

 

Thanks for your input.  I was originally going to reply that workflows were not powerful enough to do what I was wanting, but you gave me some ideas to have many different workflow trigger based on the value of a custom field.

 

I'll try this, but would still prefer a method to add to process stage though the API.



#4 Success

Success

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 13 August 2020 - 11:04 AM

@jack I am not able to insert the exact data I need into the stage using the built-in workflow files and we are still not able to figure out how to add a process stage via the API.

Any help would be great since the documentation for this does not see very clear!



#5 jack

jack

    Admin

  • Administrators
  • 61 posts

Posted 13 August 2020 - 02:23 PM

Just to clarify you are trying to create process stages from the api?



#6 Success

Success

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 17 August 2020 - 08:58 AM

Just to clarify you are trying to create process stages from the api?

Yes, we are trying to create a process stage from the API.  The same process enters the contact through the API and we want to get that contact started on a process and complete the first "COLD" stage.



#7 jack

jack

    Admin

  • Administrators
  • 61 posts

Posted 21 August 2020 - 08:34 AM

Is this what you are describing

https://imgur.com/a/PfCuKHB



#8 Success

Success

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 25 August 2020 - 04:21 AM

No it is not.... It is adding those same process stages with the API.  Not in the Workflow section...

I tried to be pretty clear this is using the API on my post 3 weeks ago from 8/10.

Here is the very unclear documentation;

http://wiki.x2crm.co...ociated_Actions



#9 X2Peter

X2Peter

    Advanced Member

  • Administrators
  • 89 posts

Posted 25 August 2020 - 02:23 PM

Hello Success,

 

I believe this is possible to do via the API. You will need to set the 'workflowId' field (this fieldname is a misnomer, it is actually the ID of the Process you would like the record to be on) and the 'stageNumber' (this is the number of the stage  of the process you would like the record to be on). Everything else should be straightforward such as the 'associationType', 'associationId' and 'createDate' fields.



#10 Success

Success

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 28 August 2020 - 04:40 AM

Hello Success,

 

I believe this is possible to do via the API. You will need to set the 'workflowId' field (this fieldname is a misnomer, it is actually the ID of the Process you would like the record to be on) and the 'stageNumber' (this is the number of the stage  of the process you would like the record to be on). Everything else should be straightforward such as the 'associationType', 'associationId' and 'createDate' fields.

 

Yes Peter, I pretty sure it is possible, we are just not able to figure it out since the documentation is lacking.
 

I'm really looking for an example or better documentation to help on this project lingering on for over a month now.



#11 X2Peter

X2Peter

    Advanced Member

  • Administrators
  • 89 posts

Posted 29 September 2020 - 02:00 PM

Hello Success,

 

You will need to update the database and the `x2_fields` table in particular. You will need to change the `readonly` attribute of `workflowId` and `stageNumber` to 0. The following should then work:

curl -H 'Content-Type: application/json' -H 'Authorization: Basic {your auth here}' --request POST --data '{"workflowId":1, "type":"workflow", "stageNumber":1}' https://{domain}/index.php/api2/{modelName}/{modelId}/Actions





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users