Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content

Can you use a response from a REST Post block in subsequent blocks


Brett Zufelt

Recommended Posts

I am using the REST Web Services connector in Scribe Connect and am trying to use the POST block to create a new record in my API. The POST request returns a response with the ID of the newly created object. I can't figure out how to be able to then read the response from the POST block and access that ID value to use it to link the newly created record to another record. The only "Operation Results" I have available from my POST block are the standard Result.ErrorDescription, Result.ErrorDetail, Result.ErrorNumber, Result.RecordsMatched, and Result.Success. There is no ID even though I have it defined in the response schema in my swagger doc. Is this expected behavior or am I doing something wrong

Here is my Swagger doc:

{

"swagger": "2.0",

"info": {

"version": "v3",

"title": "Hubspot v3 API",

"description": "Hubspot v3 API"

},

"host": "api.hubapi.com",

"schemes": [

"https"

],

"consumes": [

"application/json"

],

"produces": [

"application/json"

],

"paths": {

"/crm/v3/objects/line_items": {

"post": {

"parameters": [

{

"name": "createParams",

"in": "body",

"required": true,

"schema": {

"$ref": "#/definitions/LineItemCreateParams"

}

}

],

"responses": {

"201": {

"schema": {

"$ref": "#/definitions/LineItemCreateResponse"

}

}

}

}

}

},

"definitions": {

"LineItemCreateParams": {

"type": "object",

"properties": {

"properties": {

"$ref": "#/definitions/LineItemProperties"

}

}

},

"LineItemCreateResponse": {

"type": "object",

"properties": {

"id": {

"type": "string"

}

}

},

"LineItemProperties": {

"type": "object",

"properties": {

"name": {

"type": "string"

},

"price": {

"type": "number",

"format": "double"

},

"quantity": {

"type": "integer",

"format": "int32"

}

}

}

}

}

Link to comment
Share on other sites

  • 1 month later...

Hi Brettz,

I think leveraging the HTTP and Mapper connector extensions will help you achieve your goal.

https://help.scribesoft.com/scribe/en/index.htm#sol/conn/conn_ext.htm%3F...

With the Mapper connector you are specifiying your request and response JSON example's.

You use the HTTP to send the request (post/get etc) build with the Mapper connector and capture the response back from Hubspot in this case

 

thanks

Nick

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...