Google Calendar API not working with curl client request - json

I am trying to create a google calendar event using curl this is my request but it is not working I have not idea what is the mistake that I am making :
curl "https://www.googleapis.com/calendar/v3/calendars/{CalID}/events?access_token={access_token}" -H "Content-Type: application/json" -X POST -d '{ "end": { "start": { "date": "2012-08-01", "dateTime": "2012-08-01 22:47:31.893205", "timeZone": "Asia/Calcutta" }, "end": { "date": "2012-08-08", "dateTime": "2012-08-08 22:47:31.893205", "timeZone": "Asia/Calcutta" }, "attendees": [ { "email": "dosi#iitpzx.com" }, { "email": "test#gmail.com" } ], "reminders": { "overrides": [ { "method": "email", "minutes": 10 } ] } }' -v
I keep getting Bad request Error.
Can some tell me what is wrong with this request..??

Finally got the correct request :
curl
"https://www.googleapis.com/calendar/v3/calendars/{CalendarID}/events?access_token={Access_token}"
-H "Content-Type: application/json" -d ' { "start": { "dateTime": "2012-07-11T12:47:31+05:30" }, "end": { "dateTime":
"2012-07-11T22:47:31+05:30" }, "attendees": [ { "email":
"{Attendee_Email}" } ], "reminders": { "overrides":[ ] } }' -v

Related

Parse json response from curl in github action

I have the curl request as shown below and also attached the response of curl request from the response how can I fetch the value which is under "status.azure.resource_name" and store it in some variable as I'm new to GitHub action facing some challenges if this is some programming api I could have resolved it
Request:
curl --location --request PUT $URL \
--header "$AUTH_HEADER" \
--header 'Content-Type: application/json' \
--data-raw "$PAYLOAD"
Response:
{
"labels": {},
"spec": {
"mysql": {
"version": "8.0",
"sku": {
"name": "GP_Gen5_4"
},
"storage_profile": {
"storage_mb": 5120
}
},
"key_vault": {
"access_policies": [
{
"name": "test",
"type": "group",
"project": null
}
]
}
},
"type": "azure-mysql",
"name": "mysql",
"id": "1234",
"created_at": "2012-03-04T10:00:05+00:00",
"updated_at": "2012-03-04T10:00:05+00:00",
"project": {
"id": "ae3dfa99",
"name": "Test",
"url": "www.google.com",
"geography": "in"
},
"links": {
"key_vault": {
"endpoint": {
"url": "",
"description": "test.",
"display_name": "test"
},
"azure_portal": {
"url": "test",
"description": "Link to the resource in the Azure portal.",
"display_name": "Key Vault Azure Portal"
}
},
"azure_portal": {
"url": "test",
"description": "Link to the resource in the Azure portal.",
"display_name": "Azure Portal"
},
"endpoint": {
"url": "test",
"description": "Azure resource endpoint.",
"display_name": "test"
}
},
"url": "test",
"tags": {
"cost_center_id": "471000",
"customer": "internal",
"product_group": "internal",
"environment_type": "test",
"budget_category": "",
"team": ""
},
"spiffe_id": "test",
"status": {
"ready": false,
"state": "reconciling",
"deployment": {
"steps": {}
},
"azure": {
"resource_name": "test",
"id": null,
"subscription_id": "test",
"resource_group": "test"
},
"key_vault": {
"access_policies": []
}
}
}
There are multiple ways to achieve that.
You can use directly jq and read variable in bash step.
You can use one of existing open source actions from marketplace:
- name: get nested property
id: format_script
uses: notiz-dev/github-action-json-property#release
with:
path: 'yourjson.json'
prop_path: 'status.azure.resource_name'
- run: echo ${{steps.format_script.outputs.prop}}
Download just one property from whole JSON if you don't need a file itself:
- uses: senmu/download-json-property-action#v1.0.0
with:
url: 'https://httpbin.org/json'
property_path: status.azure.resource_name

Orion-LD issues no notification send to subscription

Update 2
The issues might be the use of the the Orion-LD (1.0.0), when i use the 0.8.0 all the example is working.
https://github.com/kosgobakis/orion-ldSubcription
My setup is:
The Things Network (LoraWAN)
IoT Agent for LoraWAN supporting TTN and NGSI-LD GitHub
Orion-LD
Quantumleap + cratedb
Minimal web server to provide JSONLD
Provision of the sensor to the IoT Agent
curl -iL -X POST \
localhost:4041/iot/devices \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"devices": [
{
"device_id": "eui-70b3d57ed004a537",
"entity_name": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
"entity_type": "LoraDevice",
"timezone": "Europe/Athens",
"attributes": [
{
"object_id": "temperature_3",
"name": "temperatureCh3",
"type": "Float",
"metadata": {"unitCode": {"type": "Property","value": "CEL"}}
},
{
"object_id": "temperature_5",
"name": "temperatureCh5",
"type": "Float",
"metadata": {"unitCode": {"type": "Property","value": "CEL"}}
}
],
"internal_attributes": {
"lorawan": {
"application_server": {
"host": "eu1.cloud.thethings.network",
"username": "XXXX#ttn",
"password": "XXXX",
"provider": "TTN"
},
"dev_eui": "XXXXX",
"app_eui": "XXXXXX",
"application_id": "XXXXXX#ttn",
"application_key": "XXXXXX",
"data_model": "application_server"
}
},
"protocol": "LORAJSON"
}
]
}'
I successfully receive data from the TTN Network (Simulation of sensor at TTN->IoTAgent->Orion-LD)
curl -X GET 'http://localhost:1026/ngsi-ld/v1/entities/?type=LoraDevice' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-H 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
-H 'Accept: application/json' |jq .
[
{
"id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
"type": "LoraDevice",
"temperatureCh3": {
"type": "Property",
"value": 27.2,
"observedAt": "2022-01-04T18:54:14.447Z",
"unitCode": "CEL"
},
"temperatureCh5": {
"type": "Property",
"value": 25.5,
"observedAt": "2022-01-04T18:54:14.447Z",
"unitCode": "CEL"
}
}
]
I use the following curl to create a new subscription to the Orion-LD
curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/subscriptions/' \
-H 'Content-Type: application/ld+json' \
-H 'NGSILD-Tenant: openiot' \
--data-raw '{
"description": "Notify me of all changes",
"type": "Subscription",
"entities": [{"type": "LoraDevice"}],
"notification": {
"attributes": ["temperatureCh3"],
"format": "normalized",
"endpoint": {
"uri": "http://quantumleap:8668/v2/notify",
"accept": "application/json"
}
},
"#context": "http://context/ngsi-context.jsonld"
}'
and verify that i have create the subscription
curl -X GET 'http://localhost:1026/ngsi-ld/v1/subscriptions/' \
-H 'NGSILD-Tenant: openiot'|jq .
{
"id": "urn:ngsi-ld:Subscription:61d53fc5fb688acae04cd92f",
"type": "Subscription",
"description": "Notify me of all changes",
"entities": [
{
"type": "LoraDevice"
}
],
"notification": {
"attributes": [
"temperatureCh3"
],
"format": "normalized",
"endpoint": {
"uri": "http://quantumleap:8668/v2/notify",
"accept": "application/json"
}
},
"#context": "http://context/ngsi-context.jsonld"
}
]
Send new measurement (Orion-LD log: Servicing NGSI-LD request 006: POST /ngsi-ld/v1/entityOperations/upsert/), check that the Orion-LD has the new data, but no notification send to the quantumleap
[
{
"id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
"type": "LoraDevice",
"temperatureCh3": {
"type": "Property",
"value": 27.3,
"observedAt": "2022-01-05T06:53:17.572Z",
"unitCode": "CEL"
},
"temperatureCh5": {
"type": "Property",
"value": 25.5,
"observedAt": "2022-01-05T06:53:17.572Z",
"unitCode": "CEL"
}
}
]
I have spend some time changing the subscription request but with no success.
Is something wrong with my subscription request?
Using MongoDB Compass here is the context of the DB
orion-openiot.entities
{
"_id": {
"id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
"type": "https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#loraSensors",
"servicePath": "/"
},
"attrNames": ["https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature1", "https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature2"],
"attrs": {
"https://ngsi-ld-tutorials=readthedocs=io/en/latest/datamodels=html#temperature1": {
"value": 27.3,
"type": "Property",
"md": {
"unitCode": {
"value": "CEL"
},
"observedAt": {
"value": 1641365597.572
}
},
"mdNames": ["unitCode", "observedAt"],
"creDate": 1641365539.6579854,
"modDate": 1641365597.5791261
},
"https://ngsi-ld-tutorials=readthedocs=io/en/latest/datamodels=html#temperature2": {
"value": 25.5,
"type": "Property",
"md": {
"unitCode": {
"value": "CEL"
},
"observedAt": {
"value": 1641365597.572
}
},
"mdNames": ["unitCode", "observedAt"],
"creDate": 1641365539.6579854,
"modDate": 1641365597.5791261
}
},
"creDate": 1641365441.9127274,
"modDate": 1641365597.5791261,
"lastCorrelator": ""
}
orion-openiot.csubs
{
"_id": "urn:ngsi-ld:Subscription:61d53fc5fb688acae04cd92f",
"expiration": 2147483647,
"reference": "http://quantumleap:8668/v2/notify",
"custom": false,
"mimeType": "application/json",
"throttling": 0,
"servicePath": "/",
"description": "Notify me of all changes",
"status": "active",
"entities": [{
"id": "",
"isPattern": "",
"type": "https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#loraSensors",
"isTypePattern": false
}],
"attrs": ["https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature1"],
"metadata": [],
"blacklist": false,
"ldContext": "http://context/ngsi-context.jsonld",
"createdAt": 1641365445.068897,
"modifiedAt": 1641365445.068897,
"conditions": [],
"expression": {
"q": "",
"mq": "",
"geometry": "",
"coords": "",
"georel": "",
"geoproperty": ""
},
"format": "normalized"
}
Update 1
I run the latest version of the IoTAgent
{"libVersion":"2.18.0-next","port":"4041","baseRoot":"/"}
and a minimal web server to provide JSONLD (http://context/xxxx.jsonld)
When created a minimal jsonld file like you suggested.
The IoT Agent send the following POST to Orion-LD
{
"url": "http://orion:1026/ngsi-ld/v1/entityOperations/upsert/?options=update",
"method": "POST",
"headers": {
"fiware-service": "openiot",
"fiware-servicepath": "/",
"Content-Type": "application/ld+json",
"NGSILD-Tenant": "openiot",
"NGSILD-Path": "/"
},
"json": [
{
"#context": "http://context/minimal.jsonld",
"temperatureCh3": {
"type": "Property",
"value": 436.8,
"unitCode": "CEL",
"observedAt": "2022-01-07T15:24:28.273Z"
},
"temperatureCh5": {
"type": "Property",
"value": 25.5,
"unitCode": "CEL",
"observedAt": "2022-01-07T15:24:28.273Z"
},
"id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
"type": "LoraDevice"
}
]
}
When i run
curl -G -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:temperaturesensor001' \
-H 'fiware-service: openiot' \
-H 'Link: <http://context/minimal.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
-H 'Accept: application/ld+json' | jq .
{
"#context": "http://context/minimal.jsonld",
"id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
"type": "LoraDevice",
"temperatureCh3": {
"value": 436.8,
"type": "Property",
"unitCode": "CEL",
"observedAt": "2022-01-07T15:24:28.273Z"
},
"temperatureCh5": {
"value": 25.5,
"type": "Property",
"unitCode": "CEL",
"observedAt": "2022-01-07T15:24:28.273Z"
}
}
And when i do not supply the correct jsonld file
curl -L -X GET \
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:temperaturesensor001' \
-H 'fiware-service: openiot' \
-H 'Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.4.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
-H 'Accept: application/ld+json'| jq .
i get the full URI
{
"#context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.4.jsonld",
"id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
"type": "https://example.com/LoraDevice",
"https://example.com/ch3": {
"value": 436.8,
"type": "Property",
"unitCode": "CEL",
"observedAt": "2022-01-07T15:24:28.273Z"
},
"https://example.com/ch5": {
"value": 25.5,
"type": "Property",
"unitCode": "CEL",
"observedAt": "2022-01-07T15:24:28.273Z"
}
}
The first thing to check is whether the IoT Agent version you are using is supporting NGSI-LD:
curl -X GET \
'http://localhost:4041/iot/about'
Should return:
{
"libVersion": "2.6.0-next",
"port": "4041",
"baseRoot": "/",
"version": "1.6.0-next"
}
The lib-version needs to be 2.15.0 or higher to expose NGSI-LD support. If necessary you can rebuild a latest from the Dockerfile in the IoTagent-LoRaWAN repo to make sure you have all the latest bug fixes from the IoT Agent node lib.
But I think the missing link here is the local #context file you need to provide to supply NGSI-LD data (and indeed any JSON-LD data). This file defines your world in terms of IRIs.
Your LoRaWAN IoT Agent config.js will need an entry to some file on a public server like:
{
contextBroker: {
host: '192.168.1.1',
port: '1026',
ngsiVersion: 'ld',
jsonLdContext: 'http://path/to/your/context.json-ld'
},
Or IOTA_CB_NGSI_VERSION and IOTA_JSON_LD_CONTEXT supplied by environment variables. The file path/to/your/context.json-ld will need to hold key-value entries like:
{
"#context": {
"type": "#type",
"id": "#id",
"ngsi-ld": "https://uri.etsi.org/ngsi-ld/",
"example": "https://example.com/",
"LoraDevice": "example:LoraDevice",
"temperatureCh3": "https://example.com/ch3",
"temperatureCh5": "https://example.com/ch5"
}
}
i.e. one entry for each entity type and one entry for each attribute.
It looks like your #context file is referring to https://fiware.github.io/data-models/context.jsonld which doesn't hold IRI values for your new property names.
When you are provisioning the subscription:
curl -X GET 'http://localhost:1026/ngsi-ld/v1/subscriptions/' \
-H 'NGSILD-Tenant: openiot'|jq .
{
"id": "urn:ngsi-ld:Subscription:61d53fc5fb688acae04cd92f",
"type": "Subscription",
"description": "Notify me of all changes",
"entities": [
{
"type": "LoraDevice"
}
],
"notification": {
"attributes": [
"temperatureCh3"
],
"format": "normalized",
"endpoint": {
"uri": "http://quantumleap:8668/v2/notify",
"accept": "application/json"
}
},
"#context": "http://path/to/your/context.json-ld"
}
]
The attribute names defined in http://path/to/your/context.json-ld are expanded to IRIs. If no matching entry is found then the default context https://uri.etsi.org/ngsi-ld/default-context/ is used (as defined by the #vocab element) , which is not what you want. Define temperatureCh3 and LoraDevice properly and the subscription will work.
As a check, try retrieving an entity without supplying any of your terms in the #context
curl -L -X GET \
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:temperaturesensor001' \
-H 'Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.4.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
-H 'Accept: application/ld+json'
All attributes (which are not defined in the core #context) should now return using IRIs - if short names are returned, then the relevant mapping is missing.
I tried to reproduce the problem, pushed a new functest to Orion-LD's develop branch for this purpose:
https://github.com/FIWARE/context.Orion-LD/pull/983
I'm unable to reproduce, so, could you please take a look at the functest I implemented (free from iot-agents, QLs, etc - just the broker, a notification receiver, and curl commands) and propose changes. See if we're able to reproduce the error. Cause if not, if I can't reproduce, then I can't fix ...
Here you can see the functest: https://github.com/FIWARE/context.Orion-LD/pull/983/files#diff-921fc6ab850278cc281e7662f6170be2e3474f95a800000779c1dd9c6c377dd6R1

when we upload .rvt files, we always got the error message "TranslationWorker-InternalFailure". the file is not corrupted we have checked

{
"type": "manifest",
"hasThumbnail": "false",
"status": "failed",
"progress": "complete",
"region": "US",
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YWRhbV8yMDE3LTA1LTI4X3RhdGFzdGVlbDEvcnN0X2Jhc2ljX3NhbXBsZV9wcm9qZWN0LnJ2dA",
"version": "1.0",
"derivatives": [
{
"name": "LMV Bubble",
"hasThumbnail": "false",
"status": "failed",
"progress": "complete",
"messages": [
{
"type": "error",
"message": "Tr worker fail to download.",
"code": "TranslationWorker-InternalFailure"
}
],
"outputType": "svf"
}
]
}
According to your urn, there would be a great possibility that your model is RVT. So, please retry with this request payload:
curl -X POST \
https://developer.api.autodesk.com/modelderivative/v2/designdata/job \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-H 'x-ads-force: true' \
-d '{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YWRhbV8yMDE3LTA1LTI4X3RhdGFzdGVlbDEvcnN0X2Jhc2ljX3NhbXBsZV9wcm9qZWN0LnJ2dA"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
]
}
]
}
}'
Note. Now Forge Model Derivative API only supports RVT files come from Revit 2016-2020.

How to issue command to Orion

I have a camera and I want to send it a command to take a snapshot. My setup is Orion <--> iotagent-json <--> mosquitto <--> device.
However, when I try to issue a command the iotagent does not receive anything.
The request I used for provisioning the device (to the agent):
curl -X POST \
http://localhost1:4041/iot/devices \
-H 'Content-Type: application/json' \
-H 'fiware-service: actuatoriot' \
-H 'fiware-servicepath: /' \
-d '{
"devices": [
{
"device_id": "actuatorCamera002",
"entity_name": "urn:ngsi-ld:ActuatorCamera:002",
"entity_type": "Actuator",
"protocol": "PDI-IoTA-UltraLight",
"transport": "MQTT",
"timezone": "Europe/Berlin",
"commands": [
{ "object_id": "screen", "name": "Screen", "type": "command"}
]
}
]
}'
The device created on Agent:
{
"device_id":"actuatorCamera002",
"service":"actuatoriot",
"service_path":"/",
"entity_name":"urn:ngsi-ld:ActuatorCamera:002",
"entity_type":"Actuator",
"transport":"MQTT",
"attributes":[
],
"lazy":[
],
"commands":[
{
"object_id":"screen",
"name":"Screen",
"type":"command"
}
],
"static_attributes":[
],
"protocol":"PDI-IoTA-UltraLight"
}
The entity created on Orion:
{
"id": "urn:ngsi-ld:ActuatorCamera:002",
"type": "Actuator",
"Screen_info": {
"type": "commandResult",
"value": "aaa",
"metadata": {}
},
"Screen_status": {
"type": "commandStatus",
"value": "UNKNOWN",
"metadata": {}
},
"TimeInstant": {
"type": "ISO8601",
"value": " ",
"metadata": {}
}
}
I have tried sending PATCH requests on the entity values but nothing seems to be getting pushed to the iotagent-json.
(I have been using the iotagent and Orion for sensor measurements and everything works fine.)
EDIT:
GET v2/registrations
[
{
"id": "5d3af2188d657958a5cefec1",
"expires": "2019-08-25T12:29:12.00Z",
"dataProvided": {
"entities": [
{
"id": "urn:ngsi-ld:ActuatorCamera:002",
"type": "Actuator"
}
],
"attrs": [
"Screen"
]
},
"provider": {
"http": {
"url": "http://localhost:4041"
},
"supportedForwardingMode": "all",
"legacyForwarding": true
},
"status": "active"
}
]
Thanks to fgalan's comment I was able to find out I was using a wrong command name when issuing the PATCH.
The correct request for issuing a command was:
curl -X PATCH \
http://<contextBrokerIp>:1026/v2/entities/urn:ngsi-ld:ActuatorCamera:002/attrs \
-H 'fiware-service: actuatoriot' \
-H 'fiware-servicepath: /' \
-d '{
"Screen": {
"type" : "command",
"value" : ""
}
}'

WSO2 identity server: phone fields using SCIM don't accept numbers

I'm using wso2 identity server version 5.0.0 with user store on mysql.
When I try to insert user with phone numbers, the phone number are not stored.
curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","password":"rossipsw","emails":"rossim#aaaa.it" ,"phoneNumbers":[{"value":"8811","type":"work"},{"value":"3473344555","type":"mobile"}]}" --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users
the result is:
Connection #0 to host localhost left intact
{"id":"f6ce5310-a2ee-4976-9579-0299029183bb","schemas":["urn:scim:schemas:core:1.0"],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","phoneNumbers":[{"type":"work"},{"type":"mobile"}],"emails":"rossim#aaaa.it","meta":{"lastModified":"2015-08-19T16:09:50","location":"https://192.168.3.43:9443/wso2/scim/Users/f6ce5310-a2ee-4976-9579-0299029183bb","created":"2015-08-19T16:09:50"}}
if I put a char in the phone number, it works fine:
curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","password":"rossipsw","emails":"rossim#aaaa.it" ,"phoneNumbers":[{"value":"_8811","type":"work"},{"value":"_3473344555","type":"mobile"}]}" --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users
the result is:
Connection #0 to host localhost left intact
{"id":"3ce83aca-6f70-4274-a2c3-5429132d6001","schemas":["urn:scim:schemas:core:1.0"],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","phoneNumbers":[{"value":"_8811","type":"work"},{"value":"_3473344555","type":"mobile"}],"emails":"rossim#aaaa.it","meta":{"lastModified":"2015-08-19T16:12:50","location":"https://192.168.3.43:9443/wso2/scim/Users/3ce83aca-6f70-4274-a2c3-5429132d6001","created":"2015-08-19T16:12:50"}}
Why? a phone number... is a number!
Phone number can be stored when enter the number within back slashes. Example : \"3473344555\"
Please find the modified curl command which works fine.
curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","password":"rossipsw","emails":"rossim#aaaa.it" ,"phoneNumbers":[{"value":\"8811\","type":"work"},{"value":\"3473344555\","type":"mobile"}]}" --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users
Result :
{"id":"a5520dfc-aa7c-4b4b-aba2-57df7b87e2e4","schemas":["urn:scim:schemas:core:1.0"],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":
"rossiusr","phoneNumbers":[{"value":"8811","type":"work"},{"value":"3473344555","type":"mobile"}],"emails":"rossim#aaaa.it","meta":{"lastModified"
:"2016-01-19T11:04:32","location":"https://localhost:9443/wso2/scim/Users/a5520dfc-aa7c-4b4b-aba2-57df7b87e2e4","created":"2016-01-19T11:04:32"}}*
Connection #0 to host localhost left intact
This is a CURL POST Request example To add Bulk users into the WSO2 Identity Server,
curl --location --request POST 'https://localhost:9443/scim2/Bulk' \
--header 'Content-Type: application/scim+json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data-raw '{
emphasized text"failOnErrors":1,
"schemas": ["urn:ietf:params:scim:api:messages:2.0:BulkRequest"],
"Operations": [
{
"method": "POST",
"path": "/Users",
"bulkId": "bulkId01",
"data": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "Test",
"password":"Mohsen123",
"name": {
"givenName": "Test01",
"familyName": "Tes01t"
},
"emails": [
{
"type": "home",
"value": "home#test.com",
"primary": true
},
{
"type": "work",
"value": "work#test.com"
},
{
"type": "other",
"value": "other#test.com"
}
]
}
},
{
"method": "POST",
"path": "/Users",
"bulkId": "bulkId02",
"data": {
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
],
"name": {
"givenName": "Test02",
"familyName": "Test02"
},
"userName": "Test02",
"password": "Mohsen123",
"emails": [
{
"type": "home",
"value": "home#test.com",
"primary": true
},
{
"type": "work",
"value": "work#test.com"
},
{
"type": "other",
"value": "other#test.com"
}
],
"phoneNumbers":[
{
"value":"8811",
"type":"work"
},
{
"value":"3473344555",
"type":"mobile"
}
],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
"employeeNumber": "1234A",
"costCenter": "hello",
"country": "country",
"dob":"dateOfBirth",
"manager": {
"value": "Admin"
}
}
}
}
]
}