Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
User avatar
By amosbatto
#814139
You need to use the POST /cases endpoint to generate the new case. Then you can link to the case.

You can use this URL if you want the top menu bar to be included:
http://localhost/sysworkflow/en/neoclas ... 8017773719

If you want to open the new case directly from an external application or web page without having to manually login, then you need to append the session ID to the URL. You can import my extraRest plugin and use the GET extrarest/session-id endpoint.
By feri10
#814151
Thank s to your reply
POST/cases generate and save data with variables parameter. i don't want this.
i want just show the form of new cases.
i login in PM with token. i don't have problem with this.
User avatar
By amosbatto
#814161
The case has to first exist in the database, before you can create a link to open the case. If the case already exists, then you can search in the APP_CACHE_VIEW table in the database for it. If it doesn't already exist, then you either have to use POST /cases or the newCase() web service to create the case.

With POST /cases, you don't have to set any new variables in the new case. Just set the variables to array() (an empty array).
User avatar
By amosbatto
#814163
Another solution is to show this URL in an <iframe> in your web page:
http://{domain-or-ip}/sys{workspace}/{lang}/{skin}/cases/casesStartPage?action=startCase?sid={session-id}
Where sid is the login session ID. If you are outside ProcessMaker, then you can install the extraRest plugin in ProcessMaker and use the GET extrarest/session-id to get the session ID.
By feri10
#814181
amosbatto wrote:The case has to first exist in the database, before you can create a link to open the case. If the case already exists, then you can search in the APP_CACHE_VIEW table in the database for it. If it doesn't already exist, then you either have to use POST /cases or the newCase() web service to create the case.

With POST /cases, you don't have to set any new variables in the new case. Just set the variables to array() (an empty array).

already i want use post newcase but i have error:
"Bad Request: Task invalid or the user is not assigned to the task"
this is my code:
Code: Select all
var oVars = {
            'pro_uid': '9230041505b8513aeeb8828027194630',
            'tas_uid': '8185424565a9a711d368884011395277',
            'variables': []
        };
                var sVars = JSON.stringify(oVars);  
$.ajax({
            url: 'http://localhost/api/1.0/workflow/cases' ,
            type: "POST",
            headers: {"Authorization": "Bearer " + accessToken,"Content-length":sVars.length},
            contentType: "application/json; charset=utf-8",
            dataType:'json',
            data:JSON.stringify(oVars),
            success:function(data) {
                //some code
            },
            error:function(error) {
                console.log(error);
            }
        });
By feri10
#814182
amosbatto wrote:Another solution is to show this URL in an <iframe> in your web page:
http://{domain-or-ip}/sys{workspace}/{lang}/{skin}/cases/casesStartPage?action=startCase?sid={session-id}
Where sid is the login session ID. If you are outside ProcessMaker, then you can install the extraRest plugin in ProcessMaker and use the GET extrarest/session-id to get the session ID.
how can i import plugin on windows 8.1?
https://github.com/amosbatto/pmcommunity/issues/1
User avatar
By amosbatto
#814198
feri10 wrote:already i want use post newcase but i have error:
"Bad Request: Task invalid or the user is not assigned to the task"
this is my code:
Code: Select all
var oVars = {
            'pro_uid': '9230041505b8513aeeb8828027194630',
            'tas_uid': '8185424565a9a711d368884011395277',
            'variables': []
        };
                var sVars = JSON.stringify(oVars);  
$.ajax({
            url: 'http://localhost/api/1.0/workflow/cases' ,
            type: "POST",
            headers: {"Authorization": "Bearer " + accessToken,"Content-length":sVars.length},
            contentType: "application/json; charset=utf-8",
            dataType:'json',
            data:JSON.stringify(oVars),
            success:function(data) {
                //some code
            },
            error:function(error) {
                console.log(error);
            }
        });
Your logged-in user isn't assigned to the task. You need to use the POST /cases/impersonate endpoint and specify a user who is assigned to the starting task in the process.
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]